compile 1_32 on darwin fails for test library (unit_test, prg_exec_monitor, etc)

I'm currently trying to compile all of boost on OS X (10.3.7), using TOOLS=darwin. I already read about the problems with xml_grammar, so I just added: #ifdef NDEBUG template class basic_xml_grammer<char>; #endif //NDEBUG This at least lets the compilation finish. And I'm not using boost::serialization yet. Hopefully Apple will get a fix (I am compiling with their latest build 1671). But I'm running into another problem during the link stage of the test libraries "libboost_unit_test_framework.dylib" It happens in both debug and release builds, I get: ld: Undefined symbols: init_unit_test_suite(int, char**) I found this function defined in auto_unit_test.hpp, and referenced in some of the .cpp files. Now, I'm guessing that this might be intentionally undefined, so that when you bind to the dynamic library, you define your own initialization (probably through a macro), and the library uses that. Has anyone else had this problem? I tried looking through the regression tests, but I haven't found anything that looks like this problem. I saw this post on the mailing list: http://thread.gmane.org/gmane.comp.lib.boost.user/6489 But there were no follow-ups, so I decided to re-post. Is this just a problem with dynamic libraries on Mac, that they can't have undefined symbols? Or is it something else? If it just means that you can only use the static library, that's fine. But why is it compiling the dynamic ones on Mac if they won't succeed? Thanks, John =:->

Is this just a problem with dynamic libraries on Mac, that they can't have undefined symbols? Or is it something else?
It's possible. I may need to add special support for that (the same as DLL in windows). If you figure out answer please let me know (including a solution preferably ;))
If it just means that you can only use the static library, that's fine. But why is it compiling the dynamic ones on Mac if they won't succeed?
There is guard in Jamfile preventing dynamic libraries to be build on NT box We could extend it to cover Mac. But in any case you could just ignore it. Static libraries supposed to be build anyway. Gennadiy

Gennadiy Rozental wrote:
Is this just a problem with dynamic libraries on Mac, that they can't have undefined symbols? Or is it something else?
It's possible. I may need to add special support for that (the same as DLL in windows). If you figure out answer please let me know (including a solution preferably ;))
This might be a solution: http://developer.apple.com/technotes/tn2002/tn2064.html#Section2 Weak linking allows you to link a symbol such that the symbol does not have to be present at runtime for the binary to continue running. Of course, your program can't actually try to use the symbol if it is non-existent, or it will crash. Instead, your code should check to see if the address of the symbol is NULL. If it is, then the symbol is not available, but if the address is a real address, then the symbol exists and can be used. I don't know that this is *quite* what we want, but weak-linking seems like it might be okay.
If it just means that you can only use the static library, that's fine. But why is it compiling the dynamic ones on Mac if they won't succeed?
There is guard in Jamfile preventing dynamic libraries to be build on NT box We could extend it to cover Mac. But in any case you could just ignore it. Static libraries supposed to be build anyway.
Gennadiy
I would say this should be implemented first, but you might try the weak linking as well. Also, why do the libraries on darwin not have any endings? On win I get "boost_python-vc71-mt-gd-1_3.dll", but on darwin I get libboost_python-d-1_32.dylib Maybe it's a 1.32 vs 1.31 thing, but I doubt it. And finally, I'm getting a problem when I try to link for: illegal reference to symbol: _PyBool_FromLong I'm trying to track it down, and first I'm going to switch back to Jamfiles to make sure I'm passing the right flags. What's weird is that I get this error if I pass -lboost_python-1_32 If I pass -lboost_python, I don't get this error, but I get a whole list of undefined symbols. What's really weird is I can't figure out what it is binding against. Because if it didn't find the library it complains about not finding a requested library. John =:->
participants (2)
-
Gennadiy Rozental
-
John A Meinel