Reputation: 1240
For some reason I have to link glibc manually. I am trying to run the following program:
#include <stdio.h>
int _start(){
printf("ABCDE");
return 0;
}
In order to compile it I type the following commands:
gcc -c main.c -o main.o
gcc -L/lib/x86_64-linux-gnu/ -nostdlib main.o -o main -lc
Unfortunately, after running ./main
i get only
Segmentation fault (core dumped)
Could anyone tell mi what i am doing wrong?
Upvotes: 0
Views: 1689