dyld_stub_binding_helper undefined symbol / crt1.o link error

Z

zapr

I am trying to compile on Mac OS X 10.4 my C program. I am stuck at the
link phase where I get (gcc 4.01):

$ 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

According to this:
http://developer.apple.com/documentation/DeveloperTools/Reference/MachOR
eference/Reference/reference.html#//apple_ref/c/func/dyld_stub_binding_h
elper

if I add the -lcrt1.o argument to the command line I get another error:

/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

any insights on how to solve this error?

--zapro

PS.
The source file (even a dummy hello world code) was compiled with:
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

gcc $(CFLAGS) -c main-test.c -o main-test.o
gcc $(CFLAGS) -fverbose-asm -S main-test.c -o main-test.S
 
M

Mark McIntyre

On Thu, 23 Nov 2006 15:47:19 -0800, in comp.lang.c ,
I am trying to compile on Mac OS X 10.4 my C program. I am stuck at the
link phase where I get (gcc 4.01):

/usr/bin/ld: Undefined symbols:
dyld_stub_binding_helper
any insights on how to solve this error?

You're missing some library or startup file for your build env. This
isn't a C question, since its specific to your environment. I suggest
you ask in an OSX or Linux development group since the gcc part will
be common over both
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
J

Jack Klein

I am trying to compile on Mac OS X 10.4 my C program. I am stuck at the
link phase where I get (gcc 4.01):

$ 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

According to this:
http://developer.apple.com/documentation/DeveloperTools/Reference/MachOR
eference/Reference/reference.html#//apple_ref/c/func/dyld_stub_binding_h
elper

if I add the -lcrt1.o argument to the command line I get another error:

/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

any insights on how to solve this error?

--zapro

PS.
The source file (even a dummy hello world code) was compiled with:
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

gcc $(CFLAGS) -c main-test.c -o main-test.o
gcc $(CFLAGS) -fverbose-asm -S main-test.c -o main-test.S

Sorry, you're asking in the wrong place. We discuss the standard C
language here, not specific tool sets or platform specific linking
issues.

You need to ask either in a gcc help group, or more likely on a group
that supports programming for your OS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top