Re: [Boost-users] [boost.test] Missing entry point when statically linking

Date: Tue, 3 Jul 2012 19:25:50 +0000 (UTC) From: Gennadiy Rozental
Tan, Tom (Shanghai
writes: #include
using namespace boost::unit_test::framework; using namespace boost::unit_test; ? test_suite* init_unit_test_suite(int argc, char *argv[]) { ??? BOOST_TEST_MESSAGE("hello test."); ? ??? return 0; } With the same build options: cl.exe /EHsc /MT main.cpp ? VC2010 compiles fine. VC2012 outputs: LINK : fatal error LNK1561: entry point must be defined.
Don't you need to link with static library? Can you try using single header variants?
Gennadiy
I am trying to use the static library, because I was under the impression that the feature in this variant would be more complete than others. With VC++ I do not have to explicitly specify the static file name in the command line if it's what you mean. And if this is the problem, the error would be like LINK : fatal error LNK1104: cannot open file 'libboost_unit_test_framework-vc110-mt-s-1_50.lib' I had a re-read of the single header variant documentation. Seems I can just switch to it. But it still seems strange that the static variant works with VC10 but not VC11.

Tan, Tom (Shanghai
I am trying to use the static library, because I was under the impression that the feature in this variant would be more complete than others.
No. This is not the case. You will not be able to have multi-file test modules though and you'll pay with some extra compilation time (probably very small on modern hardware)
With VC++ I do not have to explicitly specify the static file name in the command line if it's what you mean. And if this is the problem, the error would be like LINK : fatal error LNK1104: cannot open file 'libboost_unit_test_framework-vc110-mt-s-1_50.lib'
This is done through use of MSVC specific pragmas. Probably they work differently in VC11. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Tan, Tom (Shanghai)