c++ - Why can't I create a thread in a Boost.Test test case? -
i have defined next simple test case:
#define boost_test_module thread_test_module #include <boost/test/unit_test.hpp> #include <thread> void do_nothing() {} boost_auto_test_case ( boost_thread_test ) { std::thread t(do_nothing); t.join(); }
when runs, next error:
unknown location(0): fatal error in "boost_thread_test": std::runtime_error: operation not permitted
according this post, appears should work. why not?
compiler: gcc 4.6.3 boost: 1.55.0
the solution problem link pthread
library, adding -lpthread
linker command line.
c++ multithreading unit-testing boost
No comments:
Post a Comment