Boost 1.33.1 with STLPort 5.0
リンクに失敗するから stlport.jam の一番最後の方を弄って適当に対処。
if ! $(STLPORT_AUTOLINK)
{
STLPORT_LIB_STATIC_SUFFIX ?= "" ;
for local v in $(STLPORT_VERSIONS(5))
{
flags $(CURR_TOOLSET) FINDLIBS
<stlport-version>$(v)/<runtime-build>debug/<runtime-link>static :
stlportstl$(STLPORT_DEBUG_SUFFIX)$(STLPORT_LIB_STATIC_SUFFIX) ;
flags $(CURR_TOOLSET) FINDLIBS
<stlport-version>$(v)/<runtime-build>debug/<runtime-link>dynamic :
stlportstl$(STLPORT_DEBUG_SUFFIX) ;
flags $(CURR_TOOLSET) FINDLIBS
<stlport-version>$(v)/<runtime-build>release/<runtime-link>static :
stlport$(STLPORT_LIB_STATIC_SUFFIX) ;
flags $(CURR_TOOLSET) FINDLIBS
<stlport-version>$(v)/<runtime-build>release/<runtime-link>dynamic :
stlport ;
}
}ここで、
sudo ./bjam "-sTOOLS=gcc-stlport" "-sSTLPORT_PATH=/usr/local" "-sSTLPORT_VERSION=5.0" "-sBUILD=release
on" install
sudo ./bjam "-sTOOLS=gcc-stlport" "-sSTLPORT_PATH=/usr/local" "-sSTLPORT_VERSION=5.0" "-sBUILD=debug
on" install
エラーが出なければ OK
試しに
#ifdef _DEBUG
#define _STLP_DEBUG 1
#else
#undef _STLP_DEBUG
#endif
#include <boost/test/unit_test.hpp>
using namespace boost::unit_test_framework;
void myTest() {
BOOST_CHECK_EQUAL(1, 2);
BOOST_CHECK(true);
}
test_suite* init_unit_test_suite(int argc, char* argv[])
{
test_suite* test = BOOST_TEST_SUITE("test");
test->add(BOOST_TEST_CASE(&myTest));
return test;
}をコンパイル。
Release
g++ -pthread -L/usr/local/STLport-5.0/lib -I/usr/local/STLport-5.0/stlport/ -I/usr/local/include/boost-1_33_1/ -lstlport -lboost_unit_test_framework-gcc-mt-p -O2
Debug
g++ -pthread -L/usr/local/STLport-5.0/lib -I/usr/local/STLport-5.0/stlport/ -I/usr/local/include/boost-1_33_1/ -lstlportstlg -lboost_unit_test_framework-gcc-mt-gdp -D_DEBUG -ggdb -O
% ./a.out Running 1 test case... test.cpp(11): error in "myTest": check 1 == 2 failed [1 != 2] *** 1 failure detected in test suite "test" zsh: 12146 exit 201 ./a.out
ちゃんと動きました。