newbie [boost::test] linking in MSVC6
I have been using boost and STLPort for sometime and I have built up unit tests for my projects that have worked fine up until now. However, I've been lazy and used the #include unit_test_framework.hpp route instead linking to libraries. Now I'm stuck. My tests won't compile with STLPort 5.0.x, apparently because the complier needs more memory (I'm using MS VC++6(SP5) and I've set the complier option /Zm to extend to its maximum). So I decided to build the boost libraries (boost 1_33_1). Unfortunately, now I can't get my testing code to link with these libraries! Could anyone tell me which of the following I should be linking to (I am building in 'release' mode with multithreading)? libboost_unit_test_framework-vc6-mt-gdp-1_33_1.lib libboost_unit_test_framework-vc6-mt-gdp.lib libboost_unit_test_framework-vc6-mt-p-1_33_1.lib libboost_unit_test_framework-vc6-mt-p.lib libboost_unit_test_framework-vc6-mt-sgdp-1_33_1.lib libboost_unit_test_framework-vc6-mt-sgdp.lib libboost_unit_test_framework-vc6-mt-sp-1_33_1.lib libboost_unit_test_framework-vc6-mt-sp.lib In fact, I've tried them all without success. Here is an example error message: libboost_unit_test_framework-vc6-mt-sp-1_33_1.lib(framework.obj) : error LNK2001: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) Release/mst_gum_tree_real_dev.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Also, I simply removed the #include of unit_test_framework.hpp in my original source code. Is that correct? The remaining includes are: unit_test.hpp and floating_point_comparison.hpp. As an alternative to linking to the libraries, I have tried to include the source files in my project, as suggested in the unit test documentation, but that doesn't work either! The documentation does not appear to be up to date. What is a poor boy to do?!! Please give me some ideas
"Brian Hall"
So I decided to build the boost libraries (boost 1_33_1).
Unfortunately, now I can't get my testing code to link with these libraries!
Could anyone tell me which of the following I should be linking to (I am building in 'release' mode with multithreading)?
libboost_unit_test_framework-vc6-mt-gdp-1_33_1.lib libboost_unit_test_framework-vc6-mt-gdp.lib libboost_unit_test_framework-vc6-mt-p-1_33_1.lib libboost_unit_test_framework-vc6-mt-p.lib libboost_unit_test_framework-vc6-mt-sgdp-1_33_1.lib libboost_unit_test_framework-vc6-mt-sgdp.lib libboost_unit_test_framework-vc6-mt-sp-1_33_1.lib libboost_unit_test_framework-vc6-mt-sp.lib
There is a page in general boost docs (somewhere abound boost.build docs) that explains meaning of all these letters.
In fact, I've tried them all without success.
Here is an example error message:
libboost_unit_test_framework-vc6-mt-sp-1_33_1.lib(framework.obj) : error LNK2001: unresolved external symbol "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) Release/mst_gum_tree_real_dev.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.
Do you have this function init_unit_test_suite?
Also, I simply removed the #include of unit_test_framework.hpp in my original source code. Is that correct? The remaining includes are: unit_test.hpp and floating_point_comparison.hpp.
should be ok.
As an alternative to linking to the libraries, I have tried to include the source files in my project, as suggested in the unit test documentation, but that doesn't work either! The documentation does not appear to be up to date.
Yep. That's true, unfortunately. It should work, once you link with proper library. Gennadiy
"Gennadiy Rozental"
"Brian Hall"
wrote in message news:4515D22F.7010008@irl.cri.nz... [...] So I decided to build the boost libraries (boost 1_33_1).
Unfortunately, now I can't get my testing code to link with these libraries!
Could anyone tell me which of the following I should be linking to (I am building in 'release' mode with multithreading)?
libboost_unit_test_framework-vc6-mt-gdp-1_33_1.lib libboost_unit_test_framework-vc6-mt-gdp.lib libboost_unit_test_framework-vc6-mt-p-1_33_1.lib libboost_unit_test_framework-vc6-mt-p.lib libboost_unit_test_framework-vc6-mt-sgdp-1_33_1.lib libboost_unit_test_framework-vc6-mt-sgdp.lib libboost_unit_test_framework-vc6-mt-sp-1_33_1.lib libboost_unit_test_framework-vc6-mt-sp.lib
There is a page in general boost docs (somewhere abound boost.build docs) that explains meaning of all these letters.
http://www.boost.org/more/getting_started.html#Results -- Dave Abrahams Boost Consulting www.boost-consulting.com
Thanks, but the error message I cited below was only one of many
failures I am capable of generating when linking to my boost libraries.
Yes I do have a function 'init_unit_test_suite'. It is in a file that
seems to compile ok, but then the linker doesn't (always) find it. I am
very confused about how my boost libraries seem to be messing up the
linking process! They also appear to cause the linker not to see the
eXpat library that I use.
Let me return to the heart of my problem (ie, forget the libraries for
now).
When I #include 'unit_test_framework.hpp' in my testing code,
compliation fails and I get the error message (I cannot fix this by
setting /Zm2000 -- and it does not occur with STLPort 4.6.2).
C:\USR\STLPORT-5.0.2\STLPORT\stl/_istream.c(943) : fatal error C1076:
compiler limit : internal heap limit reached; use /Zm to specify a
higher limit
C:\USR\STLPORT-5.0.2\STLPORT\stl/_istream.c(1188) : see
reference to function template instantiation 'void __cdecl
stlp_std::_M_ignore_buffered(class stlp_std::basic_istream ,bool,bool)' being compiled Can you offer me any advice about this? If the complier really is too
short of memory, could linking to the libraries possibly get around this
problem?
Thanks
Gennadiy Rozental wrote: "Brian Hall" So I decided to build the boost libraries (boost 1_33_1). Unfortunately, now I can't get my testing code to link with these
libraries! Could anyone tell me which of the following I should be linking to (I am
building in 'release' mode with multithreading)? libboost_unit_test_framework-vc6-mt-gdp-1_33_1.lib
libboost_unit_test_framework-vc6-mt-gdp.lib
libboost_unit_test_framework-vc6-mt-p-1_33_1.lib
libboost_unit_test_framework-vc6-mt-p.lib
libboost_unit_test_framework-vc6-mt-sgdp-1_33_1.lib
libboost_unit_test_framework-vc6-mt-sgdp.lib
libboost_unit_test_framework-vc6-mt-sp-1_33_1.lib
libboost_unit_test_framework-vc6-mt-sp.lib There is a page in general boost docs (somewhere abound boost.build docs)
that explains meaning of all these letters. In fact, I've tried them all without success. Here is an example error message: libboost_unit_test_framework-vc6-mt-sp-1_33_1.lib(framework.obj) : error
LNK2001: unresolved external symbol "class boost::unit_test::test_suite
* __cdecl init_unit_test_suite(int,char * * const)"
(?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z)
Release/mst_gum_tree_real_dev.exe : fatal error LNK1120: 1 unresolved
externals Error executing link.exe. Do you have this function init_unit_test_suite? Also, I simply removed the #include of unit_test_framework.hpp in my
original source code. Is that correct? The remaining includes are:
unit_test.hpp and floating_point_comparison.hpp. should be ok. As an alternative to linking to the libraries, I have tried to include
the source files in my project, as suggested in the unit test
documentation, but that doesn't work either! The documentation does not
appear to be up to date. Yep. That's true, unfortunately. It should work, once you link with proper library. Gennadiy
participants (3)
-
Brian Hall
-
David Abrahams
-
Gennadiy Rozental