OS X Link Problems

I built boost thus: bjam "-sTOOLS=darwin" -sBUILD="debug release <runtime-link>static/dynamic" After hacking around the xml_grammar.cpp problems, I get the link errors where the following functions cannot be found. (Removed a lot of extra stuff to try and display only the library and missing function. If you'd like to see all 183 lines that is possible.) I'm wondering if some test functions that are not meant to be in the library are referenced by something included in the library. darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/debug/runtime-link-static/shared-linkable-true/libboost_prg_exec_monitor-sd-1_32.dylib ld: Undefined symbols: cpp_main(int, char**) darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/debug/shared-linkable-true/libboost_prg_exec_monitor-d-1_32.dylib ld: Undefined symbols: cpp_main(int, char**) darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/debug/shared-linkable-true/libboost_prg_exec_monitor-d-1_32.dylib ld: Undefined symbols: cpp_main(int, char**) darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/release/runtime-link-static/shared-linkable-true/libboost_prg_exec_monitor-s-1_32.dylibld: Undefined symbols:cpp_main(int, char**) darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/release/shared-linkable-true/libboost_prg_exec_monitor-1_32.dylib ld: Undefined symbols: cpp_main(int, char**) darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_test_exec_monitor.dylib/darwin/debug/runtime-link-static/shared-linkable-true/libboost_test_exec_monitor-sd-1_32.dylibld: Undefined symbols:test_main(int, char**) darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_test_exec_monitor.dylib/darwin/debug/shared-linkable-true/libboost_test_exec_monitor-d-1_32.dylibld: Undefined symbols:test_main(int, char**) darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_test_exec_monitor.dylib/darwin/release/shared-linkable-true/libboost_test_exec_monitor-1_32.dylibld: Undefined symbols:test_main(int, char**) darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_unit_test_framework.dylib/darwin/debug/runtime-link-static/shared-linkable-true/libboost_unit_test_framework-sd-1_32.dylibld: Undefined symbols:init_unit_test_suite(int, char**) -- Alan Gutierrez - alan@engrm.com

It's a good idea to put the library name in your subject line to alert its maintainer. Alan wrote:
I built boost thus:
bjam "-sTOOLS=darwin" -sBUILD="debug release <runtime-link>static/dynamic"
After hacking around the xml_grammar.cpp problems, I get the link errors where the following functions cannot be found.
(Removed a lot of extra stuff to try and display only the library and missing function. If you'd like to see all 183 lines that is possible.)
I'm wondering if some test functions that are not meant to be in the library are referenced by something included in the library.
darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/debug/runtime-link-static/shared-linkable-true/libboost_prg_exec_monitor-sd-1_32.dylib ld: Undefined symbols: cpp_main(int, char**)
darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/debug/shared-linkable-true/libboost_prg_exec_monitor-d-1_32.dylib ld: Undefined symbols: cpp_main(int, char**)
darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/debug/shared-linkable-true/libboost_prg_exec_monitor-d-1_32.dylib ld: Undefined symbols: cpp_main(int, char**)
darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/release/runtime-link-static/shared-linkable-true/libboost_prg_exec_monitor-s-1_32.dylibld: Undefined symbols:cpp_main(int, char**)
darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/release/shared-linkable-true/libboost_prg_exec_monitor-1_32.dylib ld: Undefined symbols: cpp_main(int, char**)
darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_test_exec_monitor.dylib/darwin/debug/runtime-link-static/shared-linkable-true/libboost_test_exec_monitor-sd-1_32.dylibld: Undefined symbols:test_main(int, char**)
darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_test_exec_monitor.dylib/darwin/debug/shared-linkable-true/libboost_test_exec_monitor-d-1_32.dylibld: Undefined symbols:test_main(int, char**)
darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_test_exec_monitor.dylib/darwin/release/shared-linkable-true/libboost_test_exec_monitor-1_32.dylibld: Undefined symbols:test_main(int, char**)
darwin-Link-DyLib-action bin/boost/libs/test/build/libboost_unit_test_framework.dylib/darwin/debug/runtime-link-static/shared-linkable-true/libboost_unit_test_framework-sd-1_32.dylibld: Undefined symbols:init_unit_test_suite(int, char**)
-- Alan Gutierrez - alan@engrm.com _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[ -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

Alan wrote:
I built boost thus:
bjam "-sTOOLS=darwin" -sBUILD="debug release <runtime-link>static/dynamic"
After hacking around the xml_grammar.cpp problems, I get the link errors where the following functions cannot be found.
I presume at this point everything seems to build properly.
I'm wondering if some test functions that are not meant to be in the library are referenced by something included in the library.
darwin-Link-DyLib-action
bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/debug/runti me-link-static/shared-linkable-true/libboost_prg_exec_monitor-sd-1_32.dylib
ld: Undefined symbols: cpp_main(int, char**)
darwin-Link-DyLib-action
<snip> These error messages indicate that the serialization test programs are being built but that the boost.test library isn't being linked in. If you're impatient - and who isn't - you can try to build the simplest demo program from the serialiation library. Its called, er, demo.cpp. This doesn't depend on any boost libraries other than serialization. I'll presume that didn't work. But now we can get down to business. I'm speculating a little here. This information below is (sort of) in the "Getting Started" section of the boost documentation. Your bjam command above built the libraries in a subtree called bin/boost/ .... which is pretty deep. To use any of the libraries, you have to link to them. This is kind of inconvenient. I would recommend changing the above command to: bjam "-sTOOLS=darwin" -sBUILD="debug release> <runtime-link>static/dynamic" stage The "stage" target will do everything the original did (if necessary) and copy the built directories to one single easy to use directory called $(BOOST_ROOT)/stage . These libraries can be linked to your applications to supply the library code. Going to the documentatio section "Getting Started" you will find information what will indicate the file name of the library that corresponds to the type of link you want to do debug/release, etc. so now you should be able to figure out how to link the demo applicaiton. If your really a glutton for punishment and you have about 50 G of diskspace and couple of hours of free computer time, you can run the whole boost test. I'm not going into detail here, but it would useful if you want run in release mode as boost tests are mostly run in debug builds. Good luck. Robert Ramey

On Dec 16, 2004, at 10:07 AM, Robert Ramey wrote:
Alan wrote:
I built boost thus:
bjam "-sTOOLS=darwin" -sBUILD="debug release <runtime-link>static/dynamic"
After hacking around the xml_grammar.cpp problems, I get the link errors where the following functions cannot be found.
I presume at this point everything seems to build properly.
I'm wondering if some test functions that are not meant to be in the library are referenced by something included in the library.
darwin-Link-DyLib-action
bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/ debug/runti me-link-static/shared-linkable-true/libboost_prg_exec_monitor-sd -1_32.dylib
ld: Undefined symbols: cpp_main(int, char**)
darwin-Link-DyLib-action
<snip>
These error messages indicate that the serialization test programs are being built but that the boost.test library isn't being linked in.
This an attempt to create a dynamic shared library w/ a two-level namespace & undefined symbols (cpp_main is a "call-out" from the library code). Not allowed. Must state the library (an "umbrella framework" usually) to resolve from at dynamic link time. I think this can be solved by shifting to a flat-namespace. I will try. Kon
<snip> Good luck.
Robert Ramey
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Kon Lovett wrote:
bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/ debug/runti me-link-static/shared-linkable-true/libboost_prg_exec_monitor-sd -1_32.dylib
ld: Undefined symbols: cpp_main(int, char**)
darwin-Link-DyLib-action
<snip>
These error messages indicate that the serialization test programs are being built but that the boost.test library isn't being linked in.
This an attempt to create a dynamic shared library w/ a two-level namespace & undefined symbols (cpp_main is a "call-out" from the library code). Not allowed. Must state the library (an "umbrella framework" usually) to resolve from at dynamic link time.
I think this can be solved by shifting to a flat-namespace. I will try.
I'm not sure what this means. But I can tell you that the serialization library doesn't call anything in the test library. I presumed that an attempt was being made to compile and run some of the test programs. Robert Ramey

Sorry, I wasn't implying that serialization calls into the test library. The test library calls into the user's test program. The build of the test libraries is failing here. This is not an attempt to run. It doesn't involve serialization, or any other library. The creation of test library .dylibs is failing for an esoteric darwin reason. Kon On Dec 16, 2004, at 9:37 PM, Robert Ramey wrote:
Kon Lovett wrote:
bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/ debug/runti me-link-static/shared-linkable-true/libboost_prg_exec_monitor-sd -1_32.dylib
ld: Undefined symbols: cpp_main(int, char**)
darwin-Link-DyLib-action
<snip>
These error messages indicate that the serialization test programs are being built but that the boost.test library isn't being linked in.
This an attempt to create a dynamic shared library w/ a two-level namespace & undefined symbols (cpp_main is a "call-out" from the library code). Not allowed. Must state the library (an "umbrella framework" usually) to resolve from at dynamic link time.
I think this can be solved by shifting to a flat-namespace. I will try.
I'm not sure what this means. But I can tell you that the serialization library doesn't call anything in the test library. I presumed that an attempt was being made to compile and run some of the test programs.
Robert Ramey
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

* Kon Lovett <klovett@pacbell.net> [2004-12-17 11:52]:
On Dec 16, 2004, at 9:37 PM, Robert Ramey wrote:
Kon Lovett wrote:
bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/ debug/runti me-link-static/shared-linkable-true/libboost_prg_exec_monitor-sd -1_32.dylib
ld: Undefined symbols: cpp_main(int, char**)
darwin-Link-DyLib-action
<snip>
These error messages indicate that the serialization test programs are being built but that the boost.test library isn't being linked in.
This an attempt to create a dynamic shared library w/ a two-level namespace & undefined symbols (cpp_main is a "call-out" from the library code). Not allowed. Must state the library (an "umbrella framework" usually) to resolve from at dynamic link time.
I think this can be solved by shifting to a flat-namespace. I will try.
I'm not sure what this means. But I can tell you that the serialization library doesn't call anything in the test library. I presumed that an attempt was being made to compile and run some of the test programs.
Sorry, I wasn't implying that serialization calls into the test library. The test library calls into the user's test program. The build of the test libraries is failing here. This is not an attempt to run. It doesn't involve serialization, or any other library.
The creation of test library .dylibs is failing for an esoteric darwin reason.
I'm back at this today. Attempting to get a Boost built for use with Reece Dunn's Boost GUI code. I'm failing with a simple: bjam "-sTOOLS=darwin" Just an update. -- Alan Gutierrez - alan@engrm.com

Kon Lovett writes:
bin/boost/libs/test/build/libboost_prg_exec_monitor.dylib/darwin/ debug/runti me-link-static/shared-linkable-true/libboost_prg_exec_monitor-sd -1_32.dylib
ld: Undefined symbols: cpp_main(int, char**)
<snip>
This an attempt to create a dynamic shared library w/ a two-level namespace & undefined symbols (cpp_main is a "call-out" from the library code). Not allowed. Must state the library (an "umbrella framework" usually) to resolve from at dynamic link time.
I think this can be solved by shifting to a flat-namespace. I will try.
Yep, if you change the LINKFLAGS in tools/build/v1/darwin-tools.jam to: flags darwin LINKFLAGS <target-type>$(SHARED_TYPES) : -undefined suppress -flat_namespace -Wl,-dynamic -nostartfiles -Wl,-dylib -Wl, -ldylib1.o ; then things link and run ok... troy d. straszheim
participants (6)
-
Alan
-
Alan Gutierrez
-
David Abrahams
-
Kon Lovett
-
Robert Ramey
-
troy d. straszheim