Boost installation
Frank J. R. Hanstick
trog24 at comcast.net
Mon Mar 16 23:31:36 PDT 2009
On Mar 16, 2009, at 4:28 PM, Ryan Schmidt wrote:
> On Mar 14, 2009, at 02:31, Frank J. R. Hanstick wrote:
>
>> When trying to link the installed Boost to openvrml, I ran into
>> the following:
>>
>> g++ -D_THREAD_SAFE -g -O2 -o .libs/browser browser.o -Wl,-
>> bind_at_load -L/usr/local/spidermonkey/lib/ -L/opt/local/
>> lib ./.libs/libtest-openvrml.a /Users/frank/FirefoxDownloads/
>> openvrml-0.17.11/src/libopenvrml/.libs/libopenvrml.dylib -L/sw/lib/
>> firefox2 /opt/local/lib/libjpeg.dylib /opt/local/lib/
>> libpng12.dylib /opt/local/lib/libfontconfig.dylib /opt/local/lib/
>> libiconv.dylib /opt/local/lib/libexpat.dylib /opt/local/lib/
>> libfreetype.dylib -lz -lmozjs -lplds4 -lplc4 -lnspr4 -ldl -
>> lboost_thread-mt -lboost_unit_test_framework-mt -lboost_filesystem-mt
>> /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
>> boost::system::get_system_category()
>> boost::system::get_generic_category()
>> collect2: ld returned 1 exit status
>> make[2]: *** [browser] Error 1
>> make[2]: Leaving directory `/Users/frank/FirefoxDownloads/
>> openvrml-0.17.11/tests'
>> make[1]: *** [check-am] Error 2
>> make[1]: Leaving directory `/Users/frank/FirefoxDownloads/
>> openvrml-0.17.11/tests'
>> make: *** [check-recursive] Error 1
>>
>> On an earlier attempt to link Boost to openvrml, I ran into the
>> following:
>>
>> g++ -D_THREAD_SAFE -g -O2 -o .libs/browser browser.o -Wl,-
>> bind_at_load -L/usr/local/spidermonkey/lib/ ./.libs/libtest-
>> openvrml.a /Users/frank/FirefoxDownloads/openvrml-0.17.11/src/
>> libopenvrml/.libs/libopenvrml.dylib -L/opt/local/lib -L/sw/lib/
>> firefox2 /opt/local/lib/libjpeg.dylib /opt/local/lib/
>> libpng12.dylib /opt/local/lib/libfontconfig.dylib /opt/local/lib/
>> libiconv.dylib /opt/local/lib/libexpat.dylib /opt/local/lib/
>> libfreetype.dylib -lz -lmozjs -lplds4 -lplc4 -lnspr4 -ldl -
>> lboost_thread-xgcc40-mt -lboost_unit_test_framework-xgcc40-mt -
>> lboost_filesystem-xgcc40-mt
>> /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: warning can't
>> open dynamic library: libboost_system-xgcc40-mt-1_37.dylib
>> referenced from: /usr/local/lib/libboost_filesystem-xgcc40-
>> mt.dylib (checking for undefined symbols may be affected) (No such
>> file or directory, errno = 2)
>> /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
>> boost::system::get_system_category()
>> boost::system::get_generic_category()
>> boost::system::get_system_category() referenced from libboost
>> expected to be defined in libboost_system-xgcc40-mt-1_37.dylib
>> boost::system::get_generic_category() referenced from libboost
>> expected to be defined in libboost_system-xgcc40-mt-1_37.dylib
>> collect2: ld returned 1 exit status
>> make[2]: *** [browser] Error 1
>> make[2]: Leaving directory `/Users/frank/FirefoxDownloads/
>> openvrml-0.17.11/tests'
>> make[1]: *** [check-am] Error 2
>> make[1]: Leaving directory `/Users/frank/FirefoxDownloads/
>> openvrml-0.17.11/tests'
>> make: *** [check-recursive] Error 1
>>
>> Though the earlier attempt had the Boost libraries in /usr/local/
>> lib, the earlier attempt is related to the MacPorts installed
>> attempt with one difference, the earlier recognized that the
>> dependency of libboost_system-xgcc40-mt.dylib by
>> libboost_filesystem-xgcc40-mt.dylib was needed; however, sought
>> the wrong libboost_system-xgcc40-mt.dylib. The MacPorts
>> installation did not have such recognition before hand. Quite
>> obviously, the problem is that a library dependent on another
>> library within its own set of libraries should automatically be
>> able to link to the dependent library and in one case did not
>> while in the other tried to link to an incorrect version.
>
> I don't know about your specific question, but in both sets of
> output you quote above I see
>
> -L/usr/local/spidermonkey/lib/
>
> and
>
> -L/sw/lib/firefox2
>
> So presumably you have libraries in /usr/local and /sw, neither of
> which is recommended or supported when using MacPorts. Please try
> again after you have removed or moved aside /usr/local and /sw.
>
>
I need those two libraries to create the Moziila plug-ins.
What having those two libraries has to do with libboost_filesystem-
xgcc40-mt.dylib or libboost_filesystem-mt.dylib not being able to
find their respective libboost_system dependency is beyond me. One
would think that when a library depends on another library in order
to not create undefined symbols when referenced, the library
depending on the other library would be not only know the identity of
the library it needs; but, also know where that particular library is
located. Such a dependency should have been resolved at library
build time and not need to be addressed during the building of a
program referencing the library; thus, the referencing of the
required libraries to make the plug-ins is not relevant.
In this particular case libboost_filesystem referenced
get_system_category() and get_generic_category() which are defined in
libboost_system. Why was that dependency not addressed during
libboost build time?
Frank J. R. Hanstick
trog24 at comcast.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20090316/41985ef6/attachment.html>
More information about the macports-users
mailing list