Detailed methods for Jsoncpp compilation methods and importing third-party libraries in VS2010

Source: Internet
Author: User

Detailed methods for Jsoncpp compilation methods and importing third-party libraries in VS2010

A compiled link

1 Download Jsoncpp on the respective website

2 Unzip to get jsoncpp-src-0.5.0 file

3 Open jsoncpp-src-0.5.0, makefiles, VS71, Jsoncpp.sln

4 Convert project to VS2010 format

5 Select debug mode

6 in Solution Explorer, right-click Lib_json Select only for project-only build Lib_json

7 Right-click Lib_json Select only for project-only links Lib_json

8 Select release Mode

9 Repeat operations 6 and 7

10 the generated. lib folder is in jsoncpp-src-0.5.0->build, vs71.

Two create a static link library SDK

1 Create a folder in D:\study\toolsForVS2010 (where you want to place the static link library SDK) jsonpp

2 creating folders in JSONPP include and Lib

3 Create a folder JSON in the include, copy all of the. h files in the JSON, jsoncpp-src-0.5.0, include.

4 Create folder in Lib Debug and release, put jsoncpp-src-0.5.0->build, VS71, Debug---Lib_json. lib files (such as json_vc71_ Libmtd.lib) Copy to the Debug folder (you can modify the folder name to Json.lib at this time), and similarly, jsoncpp-src-0.5.0->build, VS71, Lib_json Copy the. lib file (such as Json_vc71_libmtd.lib) to the release folder

Three open the project you want to add JSON to, or create a new WIN32 console program (add main.cpp, join source code, sample code can be found in Jsoncpp.sln json_test)

1 Select Item-Properties

2 Select Configuration Properties, c/C + +, general right "additional Include Directories" Add include folder: D:\study\toolsForVS2010\jsonPP\include

3 Select Configuration Properties, c/C + +, code generation to the right of the runtime select MTd

4 Select Configuration Properties---General right "additional library directory" Add Lib folder: D:\study\toolsForVS2010\jsonPP\lib\debug

5 Select Configuration properties, connectors, input to the right, additional dependencies add lib file: Json_vc71_libmtd.lib (if the file name Json.lib is modified in two-4, change this to Json.lib)

6 Click Apply to complete the JSON configuration.

7 If the project needs to be published (that is, the project chooses release),

A. Select configuration Properties, c/b + + code generation, to the right of the runtime select MT

B. Select the "Additional Library directory" to add the Lib folder to the general right of the connector, configuration properties, and so on: D:\study\toolsForVS2010\jsonPP\lib\release

C. You can then run the program to get release version of the program

Detailed methods for Jsoncpp compilation methods and importing third-party libraries in VS2010

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.