Missing crt1

Adriaan van Os gpc at microbizz.nl
Thu Sep 15 07:52:06 CEST 2011


Kevan Hashemi wrote:
> Hi,
> 
> I recently moved from MacOS 10.4 to 10.5 on my old PPC laptop. I 
> re-installed GPC for MacOS 10.5 from the Microbizz site. When I try to 
> compile a hello world program, I get the following error:
> 
> gpc p.pas
> /Xcode2.5/usr/bin/ld: can't locate file for: -lcrt1.o
> collect2: ld returned 1 exit status
> 
> The file crt1.o is sitting in
> 
> /Xcode2.5/SDKs/MacOSX10.4u.sdk/usr/lib
> 
> When I add the above directory to my PATH, I still have problems. My 
> path is now:
> 
> /usr/bin:/bin:/usr/sbin:/sbin:/Xcode2.5/usr/bin:/Xcode2.5/SDKs/MacOSX10.4u.sdk/usr/lib 
> 
> 
> Do I have my path set up wrong?

The PATH environment variable is not what the linker is using. Apart from linking in crt1.0 
manulally, there are two solutions to your problem:

1. Check UNIX Tools in the Xcode installer when installing Xcode. This is the simplest solution.

2. Add the command line option -Wl,-syslibroot,/Xcode2.5/SDKs/MacOSX10.4u.sdk.

Let me know if this works.

Regards,

Adriaan van Os



More information about the Gpc mailing list