Boost logo

Boost :

From: Juergen Hunold (hunold_at_[hidden])
Date: 2006-11-08 14:43:27

Hi Volodya !
Hi Gennadiy !

On Wednesday 08 November 2006 19:52, Vladimir Prus wrote:
> Gennadiy Rozental wrote:
> > "Vladimir Prus" <ghost_at_[hidden]> wrote in message
> >
> >
> >> Just a quick question: is it still true that Boost.Test libraries
> >> cannot be
> >> DLL on Windows?
> >
> > No. DLL Support is implemented. Boost.Test Jamfile is updated also
> > to support this

But not Jamfile.v2
Please find test_build.Jamfile.v2 attached for enabling shared linking
using msvc and defining "BOOST_TEST_DYN_LINK=1" on all platforms for
shared linking. This makes the behaviour consistant on all platforms
which means you'll get similar errors on all platforms...
And also adding the missing usage requierements without nothing will
work at all :-))

> 1. What are the instructions for using Boost.Test DLL on Windows?
> Some experiments results in:
>         ### mwld Linker Error:
>         #   Undefined symbol: '_main'
>         #   referenced from '_mainCRTStartup' in maincrt.c:97
>         (MSL_All-DLL_x86_D.lib)
> ..failed ..\..\..        
> \bin.v2\libs\test\test\class_properties_test.test\cw-9.4\debug\class_

With the first patch, you'll get similar errors on all platfoms.
Please patch Jamfile.v2 of Boost.Test tests with test_test.Jamfile.v2

Rationale: (or what I've figured out:)

The "main" is part of the static library, but not of the shared library
(seems to be some Win32/msvc issue, beyond my knowledge.)

The magic macro "BOOST_TEST_MAIN" will define a "main" for you when
using the " BOOST_AUTO_TEST_*" macros.
For user defined test cases, see attached file for an implementation.
(Quick copy & paste core of my own hacks used when playing around with
shared linking)

> 3. Are there any plans to modify the testsuite so that linking to DLL
> is tested?

My patch does this.
I've patches for all other libraries, which simply add
"/<link>shared" to the test libraries (see thread_test.Jamfile.v2.diff)

Those issues are hidden by V1, which builds everything statically by

I've not pressed this issue because I've got not much time to spent on
more boost libraries the BBv2 and the qt toolsets :-((.

My main questions:
- Is it really necessary to have two different setup method for
Boost.Test ? One for shared and one for static linking ?
- can we provide a (maybe special) target which will automagically
provide a "main" when linking to the shared libraries ?

Thats all for now, waiting for feedback ...



* Dipl.-Math. Jürgen Hunold  ! Ingenieurgesellschaft für 
* voice: ++49 511 262926 57  ! Verkehrs- und Eisenbahnwesen mbH  
* fax  : ++49 511 262926 99  ! Lister Straße 15
* juergen.hunold_at_[hidden]   !

Boost list run by bdawes at, gregod at, cpdaniel at, john at