Boost logo

Boost Users :

From: Gennaidy Rozental (rogeeff_at_[hidden])
Date: 2008-08-25 05:25:19


Ákos Maróy <akos <at> maroy.hu> writes:

>
> Hi,
>
> I'm having troulbe using libboost_text_exec_monitor with Visual Studio

This component is deprecated and you shouldn't use it.

> 2008. Basically a very simple test application, that initializes a test
> suite in an init_unit_test_suite() function fails to link on Visual
> Studio, when trying to link against both
> libboost_unit_test_framework-vc90-mt-gd-1_35.lib and
> libboost_test_exec_monitor-vc90-mt-gd-1_35.lib.

This is definitely an error. These are not intended to be used together. You
should get tons of duplicate symbol errors.

> I'm getting an error
> of LNK2019 saying that int __cdecl test_main(int, char ** const) is an
> unresolved external symbol. The error, strangely enough, is reported
> from libboost_test_exec_monitor-vc90-mt-fd-1_35.lib(test_main.obj),
> being a reference from the function test_main_caller::operator().
>
> The same code compiles & links fine using gcc on Linux, linking to the
> same libraries (of course without the -vc90-mt-fd-1_35 suffix). The code
> is simply:

Strange.
 
> #include <boost/test/unit_test.hpp>
>
> using namespace boost::unit_test;
>
> void test() {
> BOOST_CHECK(true);
> }
>
> test_suite *
> init_unit_test_suite(int, char **) {
> test_suite *ts = BOOST_TEST_SUITE("Test");
> ts->add(BOOST_TEST_CASE(&test));
> framework::master_test_suite().add(ts);
>
> return 0;
> }

Looks like you are using manual but straitforward test unit registration with
unit test framework
 
> Shall I add something to the above code? shouldn't the text_exec_monitor
> library contain test_main?

No. In fact, you have to delete something ;) Specifically reference to
test_exec_monitor from link line and it will work fine.

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net