Can't find crt0.o

Korv

Registered
Hi, when I try to compile (using apples gcc) a sdl program (also including the cocoa framework along with sdlmain to be able to run it nativ in OS X) and link it statically to be able to run it on my other computers that hasn't got the sdl library installed I get the following error:

Code:
ld: can't locate file for: -lcrt0.o

I never include this library in my compilation (doing it from the command line) so it most be made automatically by GCC.

I made a search for crt and I found crt1 and crt2 in my sdk, my question is if I'm missing something in the sdk and how I solve it?
 
You can link files statically. You just need to make sure that the library was compiled as a static library. Most libraries (Qt, GTK, wxWidgets) have a flag when you're configuring the library that disables dynamic linking so you can create statically linked applications. These flags are normally --disable-shared, --enable-shared=false, --enable-static or something similar. Try recompiling SDL again, this time doing ./configure --help to see what options there are for generating a static library.
 
crt.o is the C runtime library. It should definitely be on your system in /usr/lib. If it's not, something got hosed with your developer install. Try uinstalling the developer tools and reinstalling.

Wade
 
okey, thanks for all your help, I'm using the sdl-config script as 'sdl-config --static-libs' now :)
 
Back
Top