[Liblas-devel] VS2010 LNK2005 error between msvcprtd.lib and libboost

Werner Goeman wgoeman at telin.ugent.be
Thu Mar 29 04:29:43 EDT 2012


Hello Michael,

Thx for your answer.

The problem seems to be that the choices which boost gives you are a 
bit unclear, compared to the explanation in the documentation.

You need to install the multithread static libs, sais the doc.

In boost you got eight options: the one which make cmake work correctly 
is "multithread debug", that way you have libs which filename start with 
libboost*.lib. The "multithread static (debug)" nor "multithread dll 
(debug)" are doing a good job...

So, an easy solution is indeed: install all possible lib files in the 
lib directory and cmake will select the correct one for you.

Thanks again!
Werner




On Wed, 28 Mar 2012 08:05:54 -0700, Michael P. Gerlek wrote:
> I've not built in a while, but you might try the following steps:
>
>   1- download and unpack boost, from the boost website
>   2- download *all* the VS10 binaries from http://boost.teeks99.com;
> move them from the lib32 dir they come in to the <boost>/lib
>   3- run my mpg-config.bat script, after changing any paths as needed
>
> -mpg
>
>> -----Original Message-----
>> From: liblas-devel-bounces at lists.osgeo.org 
>> [mailto:liblas-devel-bounces at lists.osgeo.org] On Behalf Of Werner 
>> Goeman
>> Sent: Wednesday, March 28, 2012 4:50 AM
>> To: liblas-devel at lists.osgeo.org
>> Subject: [Liblas-devel] VS2010 LNK2005 error between msvcprtd.lib 
>> and libboost
>>
>> Setup: VS2010 – Cmake 2.8.7 – libLAS1.7.0
>>
>> This is about a LNK2005 error between msvcprtd.lib and
>> libboost_program_options-vc100-mt-sgd-1_47.lib
>>
>> I follow the documentation as close as possible. I didn’t add 
>> optional
>> libraries, only boost was installed (succesfully). CMake runs good, 
>> I
>> think, but selects the static lib which are mutlithread NOT debug 
>> mode.
>> I fixed this by manually changing the libs in CMake GUI. The 
>> solution
>> for VS was then created.
>>
>> When I try to build in VS2010, I get the same type of error all 
>> over:
>>
>> File msvcprtd.lib(MSVCP100D.dll):
>>
>> error LNK2005: "public: struct std::_Iterator_base12 * * __thiscall
>> std::_Container_base12::_Getpfirst(void)const "
>> (?_Getpfirst at _Container_base12@std@@QBEPAPAU_Iterator_base12 at 2@XZ)
>> already defined in
>> libboost_program_options-vc100-mt-sgd-1_47.lib(parsers.obj)
>> C:\Dev\libLAS\libLAS-1.7.0\src\msvcprtd.lib(MSVCP100D.dll)
>>
>> It looks to me that I need to link against the dynamic libraries of
>> boost, but when I try that, VS always tries to find the wrong libs 
>> even
>> after I manually changed the filenames to link against in CMake 
>> and/or
>> the project settings itself in VS. The thing there is that the cmake
>> construct expects the library names to begin with “libboost” which 
>> is
>> the case for static libs, but for dynamic ones it is just “boost”. 
>> When
>> trying to build, it seems that the libboost files are still linked
>> against even if they are NOT mentioned in the project settings. But 
>> in
>> the end, I don’t know if that willl solve my LNK2005 problem above…
>>
>> Can someone give a clue what is happening here?
>>
>> Thank you!
>> Werner
>> _______________________________________________
>> Liblas-devel mailing list
>> Liblas-devel at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/liblas-devel



More information about the Liblas-devel mailing list