Re: dyld_stub_binding_helper undefined symbol / crt1.o link error



On Thu, 23 Nov 2006 15:47:19 -0800, zaproheeksSPAMNO@xxxxxxxx (zapr)
wrote 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):

$ 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.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
.



Relevant Pages

  • Re: can not figure out the problem
    ... /tmp/ccAxyQSj.o: In function `main':: undefined reference to `sqrt' collect2: ld returned 1 exit status ... At first I thought is because the gcc "math.h" do not have the function ...
    (comp.lang.c)
  • Help: some error compiling glibc 2.4
    ... collect2: ld returned 1 exit status ... I'm using gcc 4.1.0, on linux ...
    (comp.os.linux.development.system)
  • Re: Gcc problem on FC6
    ... gcc -L X11 GuiExample.cpp ... _You_ must tell the compiler which libraries to link in order to ... collect2: ld returned 1 exit status ...
    (Fedora)
  • complilation error
    ... Unfortunately I get the following error when executing make ... collect2: ld returned 8 exit status ... gcc 4.0.0 ...
    (AIX-L)
  • Re: Scriptbasic - Compiling the generated C code
    ... compiler), which I have used in the past, tell me that it has a GCC ... a command line similar to Microsoft C. ... collect2: ld returned 1 exit status ...
    (comp.os.linux.development.system)