I have this infuriating problem; I'm trying to compile a simple example from Stroustrup's book on C++:
g++ char.gpp -o char
I get the following error:
ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
So, I found where crt1.10.6.o is, and set LIBRARY_PATH to:
/Developer/SDKs/MacOSX10.6.sdk/usr/lib
and then the compile step gives:
ld: warning: in char.gpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
This is in Lion with the latest Xcode newly installed. The library crt1.10.6.o seems to be the issue.
Failing that, is there a way to run the Xcode to generate a command-line executable?
g++ char.gpp -o char
I get the following error:
ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
So, I found where crt1.10.6.o is, and set LIBRARY_PATH to:
/Developer/SDKs/MacOSX10.6.sdk/usr/lib
and then the compile step gives:
ld: warning: in char.gpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
This is in Lion with the latest Xcode newly installed. The library crt1.10.6.o seems to be the issue.
Failing that, is there a way to run the Xcode to generate a command-line executable?