
Hi Mat, I just found out that the problem exists only when linking with the release lib. You were linking with the debug lib of boost_filesystem, which works fine on my system, too. Can you reproduce the error with the release lib on your system? See below for details. Mat Marcus wrote:
$bjam -d+2
---
darwin.compile.c++ ../sandbox/boost_libraries/bin.v2/libs/filesystem/build/darwin/debug/link-static/macosx-version-10.4/threading-multi/exception.o
"g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -Wno-long-double -no-cpp-precomp -gdwarf-2 -DBOOST_ALL_NO_LIB=1 -I"../sandbox/boost_libraries" -c -o "../sandbox/boost_libraries/bin.v2/libs/filesystem/build/darwin/debug/link-static/macosx-version-10.4/threading-multi/exception.o" "../sandbox/boost_libraries/libs/filesystem/src/exception.cpp"
---
On my system it looks like this:
darwin.compile.c++
bin.v2/libs/filesystem/build/darwin/release/link-static/macosx-version-10.4/threading-multi/exception.o
"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline
-Wall -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-mmacosx-version-min=10.4 -Wno-long-double -no-cpp-precomp -gdwarf-2
-DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"." -c -o
"bin.v2/libs/filesystem/build/darwin/release/link-static/macosx-version-10.4/threading-multi/exception.o"
"libs/filesystem/src/exception.cpp"
Please note that I use the release version, which explains the "-O3
-finline-functions" difference. Also, I did not modify any options, nor
did I modify the g++ environment in any way.
$ sudo mv
projects/adobe_root/boost_libraries/bin.v2/libs/filesystem/build/darwin/release/link-static/macosx-version-10.4/threading-multi/libboost_filesystem-mt-1_34_1.a
/usr/local/lib
$ ls /usr/local/lib/libboost*
/usr/local/lib/libboost_filesystem-mt-1_34_1.a
Now the simple way first:
$ g++ -c test.cpp -I./projects/adobe_root/boost_libraries -o test.o
$ g++ -o test test.o /usr/local/lib/libboost_filesystem-mt-1_34_1.a
$ ./test
terminate called after throwing an instance of
'boost::filesystem::basic_filesystem_error
darwin.compile.c++ /Users/mmarcus/pcshare/asl/staff/mmarcus/sandbox/built_artifacts/darwin/debug/asl-dev/link-static/macosx-version-10.4/threading-multi/lothar.o
"g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -Wno-long-double -no-cpp-precomp -gdwarf-2 -Werror -Wall -Wno-trigraphs -Wreturn-type -Wnon-virtual-dtor -Woverloaded-virtual -Wformat -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-parameter -Wunused-variable -Wunused-value -Wunknown-pragmas -Wsign-compare -DADOBE_SERIALIZATION -DADOBE_STD_SERIALIZATION -DBOOST_ALL_NO_LIB -DBOOST_SIGNALS_STATIC_LINK -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_USE_LIB -DNOMINMAX -I"../sandbox/adobe_source_libraries" -I"../sandbox/boost_libraries" -I"/adobe" -I"/boost" -c -o "/Users/mmarcus/pcshare/asl/staff/mmarcus/sandbox/built_artifacts/darwin/debug/asl-dev/link-static/macosx-version-10.4/threading-multi/lothar.o" "lothar.cpp"
---
darwin.link /Users/mmarcus/pcshare/asl/staff/mmarcus/sandbox/built_artifacts/darwin/debug/asl-dev/link-static/macosx-version-10.4/threading-multi/lothar
g++ -o "/Users/mmarcus/pcshare/asl/staff/mmarcus/sandbox/built_artifacts/darwin/debug/asl-dev/link-static/macosx-version-10.4/threading-multi/lothar" "/Users/mmarcus/pcshare/asl/staff/mmarcus/sandbox/built_artifacts/darwin/debug/asl-dev/link-static/macosx-version-10.4/threading-multi/lothar.o" "/Users/mmarcus/pcshare/asl/staff/mmarcus/sandbox/built_artifacts/darwin/debug/asl-dev/link-static/macosx-version-10.4/threading-multi/libasl_dev.a" "../sandbox/boost_libraries/bin.v2/libs/thread/build/darwin/debug/link-static/macosx-version-10.4/threading-multi/libboost_thread-mt-d-1_34_1.a" "../sandbox/boost_libraries/bin.v2/libs/signals/build/darwin/debug/link-static/macosx-version-10.4/threading-multi/libboost_signals-mt-d-1_34_1.a" "../sandbox/boost_libraries/bin.v2/libs/filesystem/build/darwin/debug/link-static/macosx-version-10.4/threading-multi/libboost_filesystem-mt-d-1_34_1.a" -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -Xlinker -Y -Xlinker 5 -lSystemStubs
testing.unit-test /Users/mmarcus/pcshare/asl/staff/mmarcus/sandbox/built_artifacts/darwin/debug/asl-dev/link-static/macosx-version-10.4/threading-multi/lothar.passed
/Users/mmarcus/pcshare/asl/staff/mmarcus/sandbox/built_artifacts/darwin/debug/asl-dev/link-static/macosx-version-10.4/threading-multi/lothar && touch /Users/mmarcus/pcshare/asl/staff/mmarcus/sandbox/built_artifacts/darwin/debug/asl-dev/link-static/macosx-version-10.4/threading-multi/lothar.passed
This is never printed on MacOS 10.5.
Thanks, Lothar