Re: I'm quite confused...
Re: I'm quite confused...
- Subject: Re: I'm quite confused...
- From: Chris Espinosa <email@hidden>
- Date: Fri, 21 Sep 2007 21:38:36 -0700
On Sep 21, 2007, at 9:17 PM, Adam wrote: I had an error warning that you guys helped me resolve (See Xcode Digest Vol. 4: 453/454) about prebinding, and just recently my program has started getting this error:
/usr/bin/g++-4.0 -o "/Users/atg/Desktop/Projects/Xcode Projects/Deployment/Basic_SDLOGL_001.app/Contents/MacOS/Basic_SDLOGL_001" "-L/Users/atg/Desktop/Projects/Xcode Projects/Deployment" "-F/Users/atg/Desktop/Projects/Xcode Projects/Deployment" "-F/Library/Frameworks" -filelist "/Users/atg/Desktop/Projects/Xcode Projects/Basic_SDLOGL_001.build/Deployment/Basic_SDLOGL_001.build/Objects-normal/LinkFileList" "-arch" "ppc" "-Wl,-no_arch_warnings" "-framework" "SDL" "-framework" "GLUT" "-framework" "Foundation" "-framework" "AppKit" "-framework" "OpenGL" "-framework" "Cocoa" /usr/bin/ld: Undefined symbols: _curr_piece _arr_tetris_screen _next_piece collect2: ld returned 1 exit status
So then I went and looked up what the Xcode help had to say about the subject:
When a program is built, the static linker replaces references to external symbols with the addresses of the symbols in the referenced libraries (this is called prebinding), or tells the dynamic linker to resolve the references when a program is loaded or when a symbol is referenced. Having the dynamic linker resolve references to external symbols at runtime provides the most flexibility, because a program can link with new versions of the symbols as they become available.
What I got out of that is that I need to turn on prebinding... but you guys said that I don't need it since I'm 10.4.x! So what do I do here?
I'm not sure how the above hs anything to do with prebinding. Prebinding is simply an optimization to make code load faster at runtime (at the expense of some build time).
What you're starting at, above, is a simple undefined symbol error. Your code is calling three functions (or accessing three statics):
curr_piece arr_tetris_screen next_piece
that are declared in your code or a header file it #includes but never defined by an explicit piece of code.
Maybe you're missing a .c file?
One other possibility is that you're expecting the symbols to be defined in that "SDL" framework you're linking with. Is it there? Is it built in the Deployment configuration? When it was built, did it define these three items?
It's sometimes helpful to find the "Other Linker Flags" build setting (in the Deployment configuration) and add the -t flag ("trace") to get additional information from the Linker on what it's linking from where.
Also check to see if your code compiled without warnings. A linker error is often the natural result of ignoring a compiler warning.
Chris |
_______________________________________________
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