Undefined References

Today my project decided to not work anymore. It was working fine last night but now it doesn't seem to work right. My dad did a system update last night and the power went out when installing but it says that the update installed sucessfuly. We can't do a system restore because the only backup we have is of his account and not of the computer so that won't help. Heres the output I get while trying to compile and link. It compiles fine but won't link.

It repeats for other symbols as well. I was editing the project but as soon as I tried to run it would not link. I tried this with other projects as well that I only do a clean and build and they will not link either. Does anyone know why all of a sudden it won't work?

Ok I found out how to add libstdc++.6.dylib manualy by pressing shift-control-g in the finder to get into that directory but then I get multiple definitions of lots of std things. Does anyone know why I am getting I am getting these errors without libstdc++6.dylib and the application services framework?

The same thing is happening with me and *all* of my programs. Everything compiles fine, but I am getting all kinds of strage linker errors. It all happened right after I completed the latest software update.

I am running OS X 10.3.9 and Xcode 1.5. Are you running the same? It seems likely that this latest update has somehow broken the compiler.

I was putting it off, but this weekend I am going to backup my computer, buy 10.4 at the local mac store, get set up with xcode 2.0 and try to compile all of my programs again.

Ok. Yesterday I went to the mall and got 10.4.3, installed and updated everything (although I am still at xcode 2.1), and STILL my projects didn't compile!

On just about everything I got "undefined symbols" errors. Strangely enough, I was able to fix the problem by taking all of my source files and placing them into a SINGLE folder. When I had my files organized in nice folders like "graphics", "script" and "audio", the linker couldn't seem to find anything.

I am still able to create "groups" in xcode, but as soon as I try to put my source in folders again it gives me those errors.

OneSadCookie - I cleaned and rebuilt to no avail. My gcc is still version 3.3 20030304 (Apple Computer, Inc. build 1666) after the 10.3.9 software update. Did I end up with frameworks built with GCC 4.x from the software update? Are there additional steps to get all the tools up to date through Xcode? Thanks for the help.

In versions of Mac OS X prior to version 10.3.9, the standard C++ library is packaged as the static archive file libstdc++.a. Beginning with Mac OS X version 10.3.9, the standard C++ library is packaged as the dynamic shared library libstdc++.dylib. The change in packaging brings the C++ runtime in line with the C runtime, which has always been packaged as part of the dynamic shared library libSystem.dylib. Note: To build programs that link to libstdc++.dylib, you must have GCC 4.0, which is provided with the Xcode Tools in Mac OS X 10.4. You use this compiler along with the SDKs provided by Apple to build your binary for 10.3.9. For more information, see â€œDeploying Applications Using libstdc++.dylibâ€ (page 9).

Three words

World of Pain

It looks like 10.3.9 is stranded as a development version??? Do I need to install gcc 4.0.1 from tarball to try and get my tools environment working again? Since I'm not using Xcode, maybe I can get away with installed the 2.2 SDK to get the base tools installed properly...

I'm not sure which is going to be worse, downgrading back to 10.3.4 or whatever I had or trying to make this work on 10.3.9. Arrgghh.

Well I have fmod, lua, lualib, argtable2, GiGi, GiGiSDL, log4cpp and GiGiNet as libraries, but these existed prior to the 10.3.9 upgrade and should all be built with the statically linked libc++. I am also using SDL and SDL_image frameworks but these didn't get upgraded either. The objc library and OpenGL, Cocoa, and Carbon frameworks would seem to be the candidates for now using the dynamic library. My understanding of how linkers behave when you have dynamic and static versions of the same library present is poor, but I know that this generally leads to all sorts of redefinition pain at link time, which is different than what I'm seeing.

I tried to add -lstdc++ and hid the dynamic library but this of course didn't work.

10.3.9 did something evil to my build enviroment, which is, admittedly, a bit of a hack job, but as others aren't having problems it would be nice to understand the root cause.

I'll give it a bit more investigation before I try and go back to 10.3.7 from CD, which, given Murphy's Law, will probably corrupt my OS and force a HD reformat

When I hide the 10.3.9-installed libstdc++.6.dylib, add -lstdc++ and fire up the linker it gets through my source then fails as follows:

ld: warning can't open dynamic library: /usr/lib/libstdc++.6.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
ld: Undefined symbols:
_HICopyAccessibilityActionDescription referenced from QuickTime expected to be defined in Carbon
_HICopyAccessibilityRoleDescription referenced from QuickTime expected to be defined in Carbon
_LLCStyleInfoCheckForOpenTypeTables referenced from QuickTime expected to be defined in ApplicationServices
_LLCStyleInfoGetUserRunFeatures referenced from QuickTime expected to be defined in ApplicationServices
std::__throw_bad_alloc() referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
std::_Rb_tree_decrement(std::_Rb_tree_node_base*) referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
std::_Rb_tree_increment(std::_Rb_tree_node_base*) referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
std::__throw_length_error(char const*) referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
operator delete(void*) referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
operator new(unsigned long) referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
___cxa_pure_virtual referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
___eprintf referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
___gxx_personality_v0 referenced from QuickTime expected to be defined in /usr/lib/libstdc++.6.dylib
...failed Link ../../src/client/main...
...failed updating 1 target...

I started having problems similar to yours recently too. I think I fixed it. I'm using Xcode 1.5 and OS 10.3.9.

I'm not sure if this will work for you..

All I ended up doing was changin "Cross-Develop Using Target SDK" to 10.2.8. This SDK isn't installed by default but it is on the Xcode 1.5 disk image. I also tried using the 10.3 SDK and this worked as well.

Took me forever to figure this out.. mainly because I didn't have the SDK already installed. So hopefully that will work for some of you too.