using libbost_test_exec_monitor with Visual Studio 2008?

Hi,
I'm having troulbe using libboost_text_exec_monitor with Visual Studio
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 . I'm egetting 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:
#include

Ákos Maróy
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
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

Gennaidy,
This component is deprecated and you shouldn't use it.
I see. I'm sorry...
Looks like you are using manual but straitforward test unit registration with unit test framework
yes :)
No. In fact, you have to delete something ;) Specifically reference to test_exec_monitor from link line and it will work fine.
thanks. actually the good solution was to remove all explicit boost library references, because of the auto-linking feature used for Visual Studio. I had to change one thing though, the signature of init_unit_test_suite() from: test_suite* init_unit_test_suite(int , char **) to: test_suite* init_unit_test_suite(int , char ** const) Thanks again, Akos
participants (2)
-
Gennaidy Rozental
-
Ákos Maróy