I inherited an old program from a colleague that is no longer with the company. It's an CPLEX optimization we use. It was built in house in C++ using Visual Studio 2005 and CPLEX121. The server where it's located is being decommissioned and we're trying to migrate it to a new server. I'm trying to rebuild the new application in Visual Studio 2013 using CPLEX126 for the optimizations.
Error I get is:
Description:
error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in (project name).obj
File:
ilocplex.lib(ilocplex.obj)
There are quite a few of these mismatches. I'm new to Visual Studio and C++, but I've managed to work through getting the CPLEX links updated, and now this error is happening.
From this forum post: error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in CppFile1.obj
I've been able to deduce there might be something I can do to the toolset or "recompile my libraries" this seemed to work for some people on the last post, but all I need more specific help on how exactly to do that.
No, it's the object files. What the compiler emits. They appear to be inside the .lib file. You'll need to recompile it. – David Heffernan Oct 24 '13 at 20:40
Hi David, iam new to c++ .Iam basically a c# programmmer. Can you please elaborate the comments – user1654136 Oct 24 '13 at 20:43 2
The compiler is telling you to recompile Projectname1.lib with VS2012. – David Heffernan Oct 24 '13 at 20:48
I have no idea what that means and I don't have enough reputation to comment.
Also,
for each project in your solution make sure that Properties > Config. Properties > General > Platform Toolset is one for all of them, v100 for visual studio 2010, v110 for visual studio 2012 you also may be working on v100 from visual studio 2012
the response is "That worked for me"
My Project's Platform Toolset is "Visual Studio 2013 (v120)". Do I need to add some other toolset? there's no other option in the dropdown.
There is also a block of code in the .cpp file:
// set up Visual Studio version
#define _VS2005_
# if _MSC_VER < 1400
# undef _VS2005_
# endif
I also don't know what this is doing to see if it is causing the error.