# Can't find crt0.o



## Korv (Nov 30, 2004)

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:


```
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?


----------



## Korv (Nov 30, 2004)

I made some more looking around and I found this:
http://developer.apple.com/qa/qa2001/qa1118.html
guess I can't link stuff statically, any idea on how to ensure compability any other way?


----------



## Viro (Nov 30, 2004)

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.


----------



## wadesworld (Nov 30, 2004)

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


----------



## Korv (Dec 1, 2004)

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


----------

