0

So I've recently upgraded VS2013 to VS2015 and I'm still struggling accommodating the code & project's definitions to make it work.

I have dozens of projects in my solution. I also use jsoncpp as an additional lib.

When compiling a single project, I get this error:

3>LINK : fatal error C1047: The object or library file '..\Libs\json_cpp\build\vs71\release\lib_json\json_vc71_libmt.lib' was created with an older compiler than other objects; rebuild old objects and libraries

So I've open the Libs\json_cpp\makefiles\vs71\jsoncpp.sln with VS2015 and rebuild the solution.

that didn't help.

Possible Reason

My projects are all using Platform Toolset Visual Studio 2015 - Windows XP (v140_xp) while the jsoncpp Platform Toolset is Visual Studio 2013 - Windows XP (v120_xp)

If this is indeed the issue so the obvious solution is to have both solutions compile in the same Platform Toolset Visual Studio 2015 - Windows XP (v140_xp).

Possible Solution

So, I've tried that. and got countless of these warnings:

json_value.obj : warning LNK4006: "public: static int const std::numeric_limits<unsigned short>::digits10" (?digits10@?$numeric_limits@G@std@@2HB) already defined in json_writer.obj; second definition ignored

Anybody else suffered from this agonizing process of VS upgrade and can share some insights?

idanshmu
  • 5,061
  • 6
  • 46
  • 92
  • 3
    *Possible Reason* seems like it definitely is the reason; mixing compilers/platform toolsets/... for C++ is never going to work (unless you export just a plain C API which isn't the case here). jsoncpp uses cmake, why not start from scratch and invoke CMake to create files for VS2015 and see if it builds without warnings/errors? And file a bug report to jsoncpp if it doesn't. Or, if you don't need XP support, try everything with the v140 toolset. – stijn Mar 30 '16 at 07:50
  • What @stijn said (try building from scratch) + are you using the latest (or at least recent) version of jsoncpp? – conio Mar 30 '16 at 12:06
  • @conio jsoncpp support `c++11`. what do you mean by from scratch? – idanshmu Mar 30 '16 at 12:12
  • I mean what stijn wrote - recreate the VS solution file. But on second thought I see that the jsoncpp readme recommends including the jsoncpp code directly in your solution. Is there a reason not to do that? https://github.com/open-source-parsers/jsoncpp#using-jsoncpp-in-your-project – conio Mar 30 '16 at 12:18

0 Answers0