Re: [Boost-users] [Boost.Test] Link error, need to be pointed in the right direction
* To: boost-users@xxxxxxxxxxxxxxx mailto:boost-users@DOMAIN.HIDDEN * Subject: [Boost-users] Re: [Boost.Test] Link error,need to be
* From: "Gennadiy Rozental"
mailto:gennadiy.rozental@DOMAIN.HIDDEN > * Date: Sun, 20 Mar 2005 23:50:50 -0500 * Organization: Thomson Financial * References: http://lists.boost.org/MailArchives/boost-users/msg10496.php > * Reply-to: boost-users@xxxxxxxxxxxxxxx mailto:boost-users@DOMAIN.HIDDEN * Sender: news mailto:news@DOMAIN.HIDDEN > ________________________________
You need to link with the Unit Test Framework component of Boost.Test
Compile it (using bjam or you could use project file supplied with
Hi Gennadiy, Thanks for replying. Comments following. pointed in the right direction library,
VC 2005 will cmvert it to appropriate format automatically) and add to the list of libraries to link with.
HTH,
Gennadiy
I knew I had to link it against the Unit Test Framework libraries I just wasn't sure exactly where to stipulate this. I didn't realise that you had included some VC project files as an initial starting point. Anyway I still need some help, I am almost there now .... I can feel it :p. This is what I have done. I have opened up the Version 7.1 project file(s), taking one at random ..\boost_1_32_0\libs\test\build\msvc71_proj\unit_test_example2.vcproj I converted this file to the new format. Looking through all the project settings I found a number of items that you set (or whoever initially setup the projects). The most interesting (disturbing) appears to be where you specify the lib file dependency which is set to "unit_test_framework.lib", looking through the (bjam) compiled lib directory I cannot find a lib file with that name the closest files I have are: ------------------------ D:\Development\boost\lib\dir *unit_test* Volume in drive D is Applications Volume Serial Number is A8BC-D142 Directory of D:\Development\boost\lib 03/03/2005 09:04 PM 1,385,358 libboost_unit_test_framework-vc80-mt-1_32.lib 03/03/2005 09:04 PM 6,076,308 libboost_unit_test_framework-vc80-mt-gd-1_32.lib 03/03/2005 09:04 PM 6,076,308 libboost_unit_test_framework-vc80-mt-gd.lib 03/03/2005 09:04 PM 1,936,966 libboost_unit_test_framework-vc80-mt-s-1_32.lib 03/03/2005 09:04 PM 1,936,966 libboost_unit_test_framework-vc80-mt-s.lib 03/03/2005 09:04 PM 6,957,836 libboost_unit_test_framework-vc80-mt-sgd-1_32.lib 03/03/2005 09:04 PM 6,957,836 libboost_unit_test_framework-vc80-mt-sgd.lib 03/03/2005 09:04 PM 1,385,358 libboost_unit_test_framework-vc80-mt.lib 03/03/2005 09:04 PM 1,936,678 libboost_unit_test_framework-vc80-s-1_32.lib 03/03/2005 09:04 PM 1,936,678 libboost_unit_test_framework-vc80-s.lib 03/03/2005 09:04 PM 4,495,796 libboost_unit_test_framework-vc80-sgd-1_32.lib 03/03/2005 09:04 PM 4,495,796 libboost_unit_test_framework-vc80-sgd.lib 12 File(s) 45,577,884 bytes 0 Dir(s) 297,679,298,560 bytes free ------------------------ Now I am guess I need to change that lib file to one of these. Going through the project settings I have Multi-Threading on and it is obviously in debug mode. Looking at the bottom of this page: http://www.boost.org/more/getting_started.html it describes what each of the parts of the file name means (so I need mt, g and d). Based on this information I chose: libboost_unit_test_framework-vc80-mt-gd.lib This appears to work. Is this correct? Or have a managed to add 2 + 2 and get 5? As a slight aside the IDE does not display the output of the Unit test. Was it supposed to? I was under the impression that it should have. One minor think that I think I found. Looking within the jamfile ..\boost_1_32_0\libs\test\build\Jamfile. I think that it is saying that it needs a lib file named boost_unit_test_framework. I don't know if this is or isnt the case (I have never used bjam before compiling boost), I just thought I would mention it just in case that it is wrong as well. Enough rambling from me now. Thanks for reading through this and I appreciate any help anyone can provide. Peter.
I have opened up the Version 7.1 project file(s), taking one at random ..\boost_1_32_0\libs\test\build\msvc71_proj\unit_test_example2.vcproj I converted this file to the new format. Looking through all the project settings I found a number of items that you set (or whoever initially setup the projects).
The most interesting (disturbing) appears to be where you specify the lib file dependency which is set to "unit_test_framework.lib", looking through the (bjam) compiled lib directory I cannot find a lib file with that name the closest files I have are:
Use unit_test_frameowrk.vcproj. It will create library with appropriate name and location. I personally never use bjam in production environment. bjam is good to handle multi-platform and/or configuration builds.
Looking at the bottom of this page: http://www.boost.org/more/getting_started.html it describes what each of the parts of the file name means (so I need mt, g and d).
Based on this information I chose: libboost_unit_test_framework-vc80-mt-gd.lib
This appears to work. Is this correct? Or have a managed to add 2 + 2 and get 5?
If it works then you got it.
As a slight aside the IDE does not display the output of the Unit test. Was it supposed to? I was under the impression that it should have.
The examples projects may not have Post-build event configured.
One minor think that I think I found. Looking within the jamfile ..\boost_1_32_0\libs\test\build\Jamfile. I think that it is saying that it needs a lib file named boost_unit_test_framework. I don't know if this is or isnt the case (I have never used bjam before compiling boost), I just thought I would mention it just in case that it is wrong as well.
Boost.Build system is a "smart beast". Library name in Jamfile is only logical. physical name deduced by the rules described in doc above automatically. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Peter