gcc cant create executables!!

flacochala

I`m in!!
I was trying to compile a program in c and the compiler throws me this error
/usr/bin/ld: cant locate file for: -lcrt1.o... need help.... thanxsss
 
noo... the source code is right, in fact is very simple... is a little "hello world"... but the gcc compiler downt let me turn it into an executable.. any ideas...
 
give gcc the -v flag to make it print out all commands executed at each stage in compiling. Might give you some insight into where things are going wrong.
 
thanxss.. a solutioned my problem....... i didnt install a few archives in /usr/lib... know i can compile anything
 
Was crt1.o just some object file you had in the current directory that you wanted to link into the program you were compiling? You don't need the "-l" flag for that. Just specify it like this:

gcc mainfile.c objectfile.o -o theprogram

You just have to put .o files as arguments to gcc, like you would do with any other .c files. Don't go cluttering up /usr/lib with a bunch of object files, in other words. ;-)
 
Back
Top