Boost logo

Boost-Build :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-04-09 09:36:41


The old Boost.Test test_tools framework was entirely contained in
headers, so the status/Jamfile rule invocation for a program using test
tools looked like this:

run libs/smart_ptr/smart_ptr_test.cpp ;

The new version requires library support, so I created a library build
Jamfile in the appropriate directory and changed the test invocation to
this:

run libs/smart_ptr/smart_ptr_test.cpp
<lib>../libs/test/build/boost_test ;

That worked just fine for all compilers except VC++, which gets an
unresolved external on main().

What is happening is that main() is in the <lib> file rather than in
smart_ptr_test.cpp, and VC++ can't seem to handle that.

VC++ works fine if the file (test_main.cpp) is removed from the
library, and the rule invocation is changed to:

run libs/smart_ptr/smart_ptr_test.cpp
libs/test/src/test_main.cpp
<lib>../libs/test/build/boost_test ;

If it was just one test I wouldn't worry, but to roll out this extra
work for every use of Boost.Test seems excessive.

Questions:

* Is there a way to force the Microsoft linker to resolve to main()
inside a library?

* If not, is there any plan for a <obj> attribute like <lib> which
would allow resolving to a single copy of test_main.obj instead of
having a copy for each test using it?

* Is there some completely different way to solve the problem that I
have overlooked?

--Beman

 


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