0

I am trying to build a code in VS2012 Update 4. I need it in VS2012 as I am including a thread.h file which exists in VC11 onwards. So the dll is configured to use VS 2012 (v110) platform toolset. Instead of looking for vc110 version of the boost file VS is looking for lib files of version vc100 . And when I link to those vc100 lib files, it still gives the below error. I have done a clean and rebuild still I get this error.


error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in client.obj


Used even vc110 boost files.

Toolset:

enter image description here

Libs:

enter image description here

Error:

enter image description here

What should I change to have this build error free?

Thanks for your help in advance.

razzy
  • 198
  • 1
  • 10
  • You'll have to rebuild *everything*, including static libraries you link. – Hans Passant Jun 28 '16 at 08:00
  • I have no other lib/dll included in the project. I have done a clean solution and rebuild everything. I even re-created the whole project. It is still asking for 'libboost_thread-vc100-mt-gd-1_42.lib'. My platform toolset is to v110. – razzy Jun 29 '16 at 01:52

3 Answers3

0

You need to link VC110 boost library to your application. Convert boost library into VS2012(VC110)

Mehul Donga
  • 105
  • 3
  • 14
  • but the initial error message is looking for vc100? – razzy Jun 28 '16 at 05:08
  • Have a look at this link http://stackoverflow.com/questions/12398809/c-boost-filesystem-mismatch-detected-for-msc-ver-value-1700-doesnt – Mehul Donga Jun 28 '16 at 05:16
  • I had seen that. In there there are 2 error messages. The first states its looking for file 'libboost_filesystem-vc100-mt-gd-1_51.lib meaning it needs a boost lib build using VS2010 as stated by vc100. In 2nd Error message 'Value 1700 does not match with 1600' and I believe 1600 is for vc100. But in my case the error messages state its looking for vc100 and I have provided it. Correct me if I am wrong. I myself trying to understand why there is a mismatch. Shouldn't the error be stating its looking for lib file version vc110 instead of vc100? – razzy Jun 28 '16 at 06:06
  • Could you please upload your project on google drive or Dropbox, So we can have a look at your problem. – Mehul Donga Jun 29 '16 at 11:47
  • I have reverted back to using VS2010 and used the thread header in boost instead. So its all good. – razzy Jun 30 '16 at 00:56
0

Boost library built for VS2010 cannot be used with VS2012. If you have have already built boost library for VS2012, you can specify the path to this library in your project: properties->Configuration->Linker->General. Also change the include directory path from properties->Configuration->C/C++->General. Otherwise you will have to build the library for VS2012 and use it.

Also make sure that path of boost library in properties->Configuration properties->VC++ Directories is the proper one.

Jackzz
  • 1,417
  • 4
  • 24
  • 53
  • I have already build the boost and included it in the project. But the error message states its looking for lib built for vc100. – razzy Jun 28 '16 at 06:07
  • Did u build boost using VS2012?Are u sure about it? And did you check your linker path – Jackzz Jun 28 '16 at 06:08
  • Fyi, I have added a screenshot of the lib file I have added to the project. Have you used boost before? – razzy Jun 28 '16 at 06:41
  • Can you check the path set in properties->Configuration properties->VC++ Directories. – Jackzz Jul 04 '16 at 04:45
  • I have reverted back to using VC100. – razzy Jul 04 '16 at 04:47
  • ok.. I got the same error last day and the problem was with the path set in VC++ directories..Changing the path and rebuilding solved my issue – Jackzz Jul 04 '16 at 04:50
  • was your error message looking for vc100 or vc110? I will try your method with a fresh project just for my own investigation. It just does not make sense that VS will look for vc100 lib file when its toolset is set to vc110. – razzy Jul 04 '16 at 05:05
  • Yes..it was looking for vc100. The VC++ directories path was set with the path containing vc100 libraries. I had to change it to the path of vc110 libraries. The toolset was vc110 itself. – Jackzz Jul 04 '16 at 05:24
0

I also encountered the same problem, I solved the problem by changing the following cpp file, I hope this will be helpful to you.

Steps:

  1. Find the cpp file in the boost source code file. File path: boost_1_42_0\boost\config\auto_link.hpp
  2. Change the code Old code: # define BOOST_LIB_TOOLSET "vc100" Fix code: # define BOOST_LIB_TOOLSET "vc110"
  3. Rebuild the solution
  4. Build succeeded