Boost logo

Boost-Build :

Subject: [Boost-build] issue with <link>
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2009-01-02 13:20:12


I have following issue with compilation of one of the unit tests from
Boost.Test which uses single-header version of Program Execution Monitor
(no linking, just single included header). Boost.Test Jamfile has
following lines:

project boost/test
     : source-location ../src
     : requirements <link>shared:<define>BOOST_TEST_DYN_LINK=1
                    ...
     : usage-requirements
                    <define>BOOST_TEST_NO_AUTO_LINK=1
                    <link>shared:<define>BOOST_TEST_DYN_LINK=1
                    ...

...

alias included : : : :
                    <toolset>msvc:<asynch-exceptions>on
        ;

Boost.Test's test Jamfile has following lines:

test-suite "prg_exec_monitor_test"
         : [ test-btl-lib run-fail : prg_exec_fail1 : included ]

which results in something like:

run-fail prg_exec_fail1 ../build//included ;

bjam compilation produces:

file
..\..\..\bin.v2\libs\test\test\prg_exec_fail1.test\msvc-7.1\debug\asynch-exceptions-on\threading-multi\prg_exec_fail1.obj.rsp
"prg_exec_fail1.cpp"
 
-Fo"..\..\..\bin.v2\libs\test\test\prg_exec_fail1.test\msvc-7.1\debug\asynch-exceptions-on\threading-multi\prg_exec_fail1.obj"
    -TP
  /Z7
  /Od
  /Ob0
  /W3
  /GR
  /MDd
  /Zc:forScope
  /Zc:wchar_t
  /Wp64
  /GB
  /Op
  /wd4675
  /EHs
  /EHa
  -wd4275
  -c

-DBOOST_ALL_NO_LIB=1

-DBOOST_TEST_DYN_LINK=1

-DBOOST_TEST_NO_AUTO_LINK=1

"-I..\..\.."

compile-c-c++
..\..\..\bin.v2\libs\test\test\prg_exec_fail1.test\msvc-7.1\debug\asynch-exceptions-on\threading-multi\prg_exec_fail1.obj

     call "C:\Compilers\Microsoft Visual Studio .NET
2003\Vc7\bin\vcvars32.bat" >nul
cl /Zm800 -nologo
@"..\..\..\bin.v2\libs\test\test\prg_exec_fail1.test\msvc-7.1\debug\asynch-exceptions-on\threading-multi\prg_exec_fail1.obj.rsp"

cl : Command line warning D4025 : overriding '/EHs' with '/EHa'
prg_exec_fail1.cpp
..\..\..\boost\test\impl\execution_monitor.ipp(1018) : warning C4273:
'boost::execution_monitor::catch_signals' : inconsistent dll linkage
..\..\..\boost\test\impl\execution_monitor.ipp(1088) : warning C4273:
'boost::execution_monitor::execute' : inconsistent dll linkage
...

It looks like <link>shared where applied even though I do not link with
anything.

The only way to circumvent this I found is to define

alias included : : : :
                    <link>static
                    <toolset>msvc:<asynch-exceptions>on
        ;

which does not seems right as well.

What is the right solution?

Gennadiy


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk