[test] symbol not defined: execution_exception

When I include header <boost/test/unit_test.hpp> in my program, the linker complains that symbol "execution_exception" is undefined. I looked at the compiler output and found that class "execution_exception" is a parameter on "virtual void exception_caught(execution_exception const&)" in file test_observer.hpp. It is declared but never defined. I added "#include <boost/test/execution_monitor.hpp>" to file test_observer.hpp and the linker error went away. Is this the correct way to fix the problem? Thanks, Dave Jenkins

"Dave Jenkins" <david@jenkins.net> wrote in message news:fi71bn$106$1@ger.gmane.org...
When I include header <boost/test/unit_test.hpp> in my program, the linker complains that symbol "execution_exception" is undefined. I looked at the compiler output and found that class "execution_exception" is a parameter on "virtual void exception_caught(execution_exception const&)" in file test_observer.hpp. It is declared but never defined.
What is?
I added "#include <boost/test/execution_monitor.hpp>" to file test_observer.hpp and the linker error went away. Is this the correct way to fix the problem?
Doesn't look like it. If it compiles it should work file. The exception is implemented in the library.
Thanks, Dave Jenkins
What compiler r u using? Can you create small example? Gennadiy

"Gennadiy Rozental" <rogeeff@gmail.com> wrote in message news:fiv3oi$1oc$1@ger.gmane.org...
"Dave Jenkins" <david@jenkins.net> wrote in message news:fi71bn$106$1@ger.gmane.org...
When I include header <boost/test/unit_test.hpp> in my program, the linker complains that symbol "execution_exception" is undefined. I looked at the compiler output and found that class "execution_exception" is a parameter on "virtual void exception_caught(execution_exception const&)" in file test_observer.hpp. It is declared but never defined.
What is?
The symbol "execution_exception". It is forward declared but does not have a definition. I verified this by looking at the preprocessor output. I was able to successfully compile and run all the Xpressive tests and examples with the /clr flag under msvc-9.0, after I added "#include <boost/test/execution_monitor.hpp>" to file "test_observer.hpp" to fix the linker warning. The warning is "LNK4248: unresolved typeref token (01000015) for 'boost.execution_exception'".
If it compiles it should work fine. The exception is implemented in the library.
Oops, maybe I should have compiled the library with /clr too. Anyway, here is an example command line and program to duplicate the problem under msvc-8.0: Thanks, Dave Jenkins cl /clr test_1.cpp -I%BOOST_ROOT% /link libboost_unit_test_framework-vc80-mt-1_35.lib /ENTRY:main // test_1.cpp #include <boost/test/unit_test.hpp> // #include <boost/test/execution_monitor.hpp> void test1() {} using namespace boost::unit_test; test_suite* init_unit_test_suite( int argc, char* argv[] ) { test_suite *test = BOOST_TEST_SUITE("test1"); test->add(BOOST_TEST_CASE(&test1)); return test; }

"Dave Jenkins" <david@jenkins.net> wrote in message news:fivsn4$vr8$1@ger.gmane.org...
If it compiles it should work fine. The exception is implemented in the library.
Oops, maybe I should have compiled the library with /clr too.
Anyway, here is an example command line and program to duplicate the problem under msvc-8.0: Thanks, Dave Jenkins
cl /clr test_1.cpp -I%BOOST_ROOT% /link libboost_unit_test_framework-vc80-mt-1_35.lib /ENTRY:main
// test_1.cpp #include <boost/test/unit_test.hpp> // #include <boost/test/execution_monitor.hpp> void test1() {} using namespace boost::unit_test; test_suite* init_unit_test_suite( int argc, char* argv[] ) { test_suite *test = BOOST_TEST_SUITE("test1"); test->add(BOOST_TEST_CASE(&test1)); return test; }
I have no problems compiling and linking this example with regular options. I know very little about CLR, but I would guess library and executable compilation options should coincide. Gennadiy
participants (2)
-
Dave Jenkins
-
Gennadiy Rozental