Link errors on dyld_stub_binding_helper, multiple definitions of __start
Link errors on dyld_stub_binding_helper, multiple definitions of __start
- Subject: Link errors on dyld_stub_binding_helper, multiple definitions of __start
- From: "abstract water" <email@hidden>
- Date: Thu, 23 Nov 2006 21:44:29 -0800
Hi, I am using Tiger, Xcode 2.3, gcc 4.01 and I am porting some C
sources to OS X, except that I'm stuck at the link phase. Compilation
succeeds with the following:
gcc $(CFLAGS) -c main.c -o main.o
gcc $(CFLAGS) -fverbose-asm -S main.c -o main.S
CFLAGS = -s -Os -Wall -fprofile-arcs -fpack-struct -fno-common
-ffast-math -ffloat-store -fno-strict-aliasing -fno-align-functions
-fno-align-labels -fno-align-loops -fno-align-jumps
-fsingle-precision-constant
-F/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks
However, the link command fails with the error below
gcc -s -Os -Wall -fprofile-arcs -fpack-struct -fno-common -ffast-math
-ffloat-store -fno-strict-aliasing -fno-align-functions
-fno-align-labels -fno-align-loops -fno-align-jumps
-fsingle-precision-constant -nostdlib -nodefaultlibs -nostartfiles
main.o -lpthread /Library/Frameworks/SDL.framework/Versions/A/SDL
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL -lgcc -o
intro
/usr/bin/ld: Undefined symbols:
dyld_stub_binding_helper
collect2: ld returned 1 exit status
make: *** [intro] Error 1
I looked up that symbol and found this:
http://developer.apple.com/documentation/DeveloperTools/Reference/MachOReference/Reference/reference.html#//apple_ref/c/func/dyld_stub_binding_helper
so I added a "-lcrt1.o" argument to the command line (the product is
an executable) but then I got a different error I can't solve for the
life of me:
/usr/bin/ld: multiple definitions of symbol __start
main.o definition of __start in section (__TEXT,__text)
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../crt1.o private
external definition of __start in section (__TEXT,__text)
collect2: ld returned 1 exit status
make: *** [intro] Error 1
I tried adding "-multiply_defined suppress" to no avail.
What can I do to get rid of that error?
Thanks in advance,
Ed
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden