Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ld: can't map file, errno=22 file 'union' for architecture x86_64 error in traces for union #17

Open
flx25 opened this issue Jan 24, 2023 · 0 comments

Comments

@flx25
Copy link

flx25 commented Jan 24, 2023

Hey, i am not sure if this is an error on my side, but for the union exercise i recieve this error in the traces:

`ld: can't map file, errno=22 file 'union' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

$
-------
./sourcezpadintqfwjy$
-------
./sourcedf6vwg4tha$
-------
./sourceint pha$
-------
$
-------
./sourceAat$
-------

`

my code is:

`#include <unistd.h>

void searchforletters(char *str1, char *str2, int *str1l, int *str2l)
{
	int i;
	int wrote[127] = {0};
	i = 0;
	while (str1[i])
		{
			str1l[str1[i]]++;
			i++;
		}
	i = 0;
	while (str2[i])
		{
		str2l[str2[i]]++;
		i++;
		}
	i = 0;
	while (str1[i])
	{
		if ((str1l[str1[i]] >= 1 || str2l[str1[i]] >= 1) && wrote[str1[i]] == 0)
		{
			write(1, &str1[i],1);
			wrote[str1[i]]++;
		}
		i++;
	}
	i = 0;
		while (str2[i])
	{
		if ((str1l[str2[i]] >= 1 || str2l[str2[i]] >= 1) && wrote[str2[i]] == 0)
		{
			write(1, &str2[i],1);
			wrote[str2[i]]++;
		}
		i++;
	}
	write(1, "\n", 1);

}

int main(int argc,char** argv)
{
	int str1l[127] = {0};
	int str2l[127] = {0};
	if (argc != 3)
			write(1, "\n", 1);
	if (argc == 3)
		searchforletters(argv[1], argv[2], str1l, str2l);
	return (0);
}
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant