Subject: [boost] Boost.Test: documenting a little Mac OS X usage nit
From: Owen Smith (ods94065_at_[hidden])
Date: 2009-03-03 13:01:37
I'd like to present a little tiny puzzle that took me an
embarrassingly long time to solve--a year, to be specific. (OK, maybe
a day poking around, followed by a year being buried in the bug queue.
:-) ) With this comes a couple of requests for the Boost.Test
If i understand correctly, the Boost.Test library
boost_unit_test_framework is a little bit odd in that the static
version of the library carries a main() routine (which I intend to
take advantage of) whereas the dynamically linked version does not. In
Mac OS X, with the standard MacPorts installation of boost, this poses
a problem because both static and dynamic libraries are built and
installed to the same location. When linking with gcc using my usual
-L and -l options, given the choice, the linker will always select the
dynamic library, and I will be missing my main().
(I should point out this would be a non-issue if the main() routine
were in a different library that you could choose to include or not
include as you wish, but I'm assuming this battle has long since been
fought and resolved.)
First, I know the main() issue has been mentioned many times on the
list before, but I couldn't find any documentation of it in the 1.38.0
manual. This seems like a significant issue to document--am I just
missing it somewhere?
Second, the best workaround we found for this problem was to
explicitly select the static library by foregoing the -L and -l
options and directly specifying
<full-path>/libboost_unit_test_framework-mt.a as one of the linker
arguments. And this is what I'd like to see documented--either as a
footnote to "Unit Test Framework > User's guide > Usage variants >
Static library", or maybe as part of the topic "Unit Test Framework >
Usage recommendations > Generic".
I'm happy to prepare documentation patches if desired.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk