[C++-sig] boost on OS X

Gary Robinson grobinson at goombah.com
Thu Jun 23 21:45:58 CEST 2005


Despite the errors reported earlier, I decided to go ahead and try the tutorial
for boost.python.

In libs/python/example/tutoral, I did:


bjam   "-sPYTHON_ROOT=/System/Library/Frameworks/Python.framework/Versions/2.3"
"-sPYTHON_VERSION=2.3" "-sTOOLS=darwin" ...found 1715 targets... ...updating 5
targets... MkDir1
../../../../bin/boost/libs/python/example/tutorial/hello.so/darwin MkDir1
../../../../bin/boost/libs/python/example/tutorial/hello.so/darwin/debug MkDir1
../../../../bin/boost/libs/python/example/tutorial/hello.so/darwin/debug/shared-
linkable-true darwin-C++-action
../../../../bin/boost/libs/python/example/tutorial/hello.so/darwin/debug/shared-
linkable-true/hello.o darwin-Link-action
../../../../bin/boost/libs/python/example/tutorial/hello.so/darwin/debug/shared-
linkable-true/hello.so Chmod1
../../../../bin/boost/libs/python/example/tutorial/hello.so/darwin/debug/shared-
linkable-true/hello.so ...updated 5 targets...

It looked like it worked.

The tutoral says that it was supposed to have made libboost_python.so and
hello.so.

It did in fact make hello.so, but I could find no trace of libboost_python.so on
my hard drive. When I tried to import hello.so, I got:

ImportError: Failure linking new module:
../../../bin/boost/libs/python/build/libboost_python.dylib/darwin/debug/shared-
linkable-true/libboost_python.dylib: dyld: python can't open library:
../../../bin/boost/libs/python/build/libboost_python.dylib/darwin/debug/shared-
linkable-true/libboost_python.dylib  (No such file or directory, errno = 2)


This confused me a bit because I thought it was going to want libboost_python.so
rather than libboost_python.dylib, and also because libboost_python.dylib
actually is in a directory with the specified path ending:

ls -l
~/Desktop/boost_1_32_0/bin/boost/libs/python/build/libboost_python.dylib/darwin/
debug/shared-linkable-true/libboost_python.dylib -rwxr-xr-x  1 root  staff 
5253136 23 Jun 11:55
/Users/garyrob/Desktop/boost_1_32_0/bin/boost/libs/python/build/libboost_python.
dylib/darwin/debug/shared-linkable-true/libboost_python.dylib


So now I'm pretty mystified.

Any help would be most appreciated.

Thanks, Gary





More information about the Cplusplus-sig mailing list