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

Michael P. Gerlek mpg at flaxen.com
Wed Mar 28 11:05:54 EDT 2012


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