Boost logo

Boost :

Subject: [boost] [build] guru needed: static vs dynamic lib conundrum for serialization/filesystem library
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-08-03 13:53:50


The serialiation library uses the boost.filesystem component in it's tests.

On tests which test dlls on windows I'm getting an error:

test_dll_exported.cpp
..\..\..\boost\filesystem\config.hpp(69) : fatal error C1189: #error : Must
not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK

    call "C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\bin\vcvars32.bat" >nul
cl /Zm800 -nologo
@"..\..\..\bin.v2\libs\serialization\test\test_dll_exported.test\msvc-7.1\debug\link-static\threading-multi\test_dll_exported.obj.rsp"

Which I've traced to the command line

"test_dll_exported.cpp" -Fo"..\..\..\bin.v2\libs\serialization\test\test_dll_exported.test\msvc-7.1\debug\link-static\threading-multi\test_dll_exported.obj"
 -TP /Z7 /Od /Ob0 /W4 /GR /MDd /Zc:forScope /Zc:wchar_t /Wp64 /GB /Op
/wd4675 /EHs -Gy -wd4996 -c
-DBOOST_ALL_NO_LIB=1
-DBOOST_FILESYSTEM_DYN_LINK=1
-DBOOST_FILESYSTEM_STATIC_LINK=1
-DBOOST_LIB_DIAGNOSTIC=1
-DBOOST_SYSTEM_DYN_LINK=1
-DBOOST_SYSTEM_STATIC_LINK=1
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_DEPRECATE
-D_SCL_SECURE_NO_WARNINGS
"-I..\..\.."

which is produced by BJAM.

The test application creates a DLL which is part of the test.

BUT the dll created, as well as the serialization library used have been
created with static linking. I'm assuming that the file system library is
also created this way. I "think" this should be OK even though some C++
runtime code will be repeated between the DLL and the mainline test
components and that this might create a problem so it's probably not the
best practice. Never the less, users do this and I want to test it.

I believe that the problem resides in some thing in the BJAM files related
to filesystem libraries or test but I've been unable to track it down
further than the above.

Any help would be appreciated.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk