1

Could someone please let me know the exact steps in getting jsoncpp library to work on visual studio 2008. I am pretty new to visual studio, so don't quite understand how to go about this and I want to use jsoncpp for an MFC application. I read the readme of jsoncpp, and installed python on my machine, but I am still quite unclear about the remaining steps. Any help would be greatly appreciated. Thanks.

2 Answers 2

1

I recently added CMake build for jsoncpp -- will support various flavor of visual studio.

Both Debug/Release will be built and stored in ./stage directory.

Sign up to request clarification or add additional context in comments.

2 Comments

Does it support VS 2013 and Windows 8?
CMake supports VS2013 (cmake.org/cmake/help/v2.8.11/cmake.html#gen:VisualStudio12) so should work.
0

The jsoncpp README file, unfortunately, does not list Visual Studio 2008 as a supported build.

However, jsoncpp on vc90? has an answer which points out that there is no need to use SCONs, because somebody already created and included a Visual Studio project (lib_json.vcproj) inside the "makefiles\vs71" directory (which should be included with the JSON files that you download from http://sourceforge.net/projects/jsoncpp/).

This Visual Studio project is for an older version of Visual Studio. However, if you open it within Visual Studio 2008, it should convert just fine, at which point you can build it within Visual Studio 2008, and then you should have the necessary .lib file you need for your project.

7 Comments

Thanks for your reply. So now how do I link my project to use jsoncpp, I mean I'll have to specify the path to the jsoncpp directory somewhere correct, in Visual studio? Is it somewhere in project properties that I specify the path to where my jsoncpp folder resides?
Right-click on the project in the Solution Explorer, and select Project Settings (or whatever the name is). Then, dig around until you find the section of Linker settings. One of the many entries will be for "additional library paths". Type the path to the directory that contains the jsoncpp .lib file. (This can be relative, or the full path.) Then, there is another edit box somewhere where you can type the name of the jsoncpp .lib file (not including directory). Be sure to do all this for both Debug and Release. Then, build the project.
But there is no jsoncpp.lib file in the jsoncpp project. I included the lib_json.vcproj project in my solution. So basically my solution at this moment contains my actual mfc project and lib_json.vcproj. I compile the entire solution, both projects compile fine. But when I include "json.h" file in one of the files of my mfc project, it is not able to find it. I am pretty sure I am missing something really obvious, but not exactly able to figure out what because of no prior experience with visual studio.
I set the project dependency, the build order and also added a reference to jsoncpp project. But nothing seems to be working.
You need to add the path to the json.h file in your other project - adding the json project as a dependency project won't do that for you. You can add the path either as a global preference (Tools -> Options -> Projects and Solutions -> VC++ Directories -> "Show Directories For" dropdown list -> "Include Files" -> then add the path. Or, in the Project Properties, C++ settings, find the "Include Directories" and add it there.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.