ADD .lib file in visual studio code c++

Viewed 1590

I need to include jsoncpp in my visual studio code.

Is there any way to include .lib file in visual studio code?

this is my c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/*",
                "${workspaceFolder}/C++Script/Dependencies/include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.16299.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.12.25827/bin/Hostx64/x64/cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "msvc-x64"
        }
    ],
    "version": 4
}

enter image description here

I included json.h( although my compiler says it can't find the header file ) and I would like to include .lib file as well.

Can you tell me how to do that? I do know how to do this in visual studio. ( with liker )

1 Answers

c_cpp_properties.json is for Intellisense, you need to use tasks.json. Example:

{
    "version": "2.0.0",
    "tasks": [
      {
        "type": "shell",
        "label": "cl.exe build active file",
        "command": "cl.exe",
        "args": [
          "/Zi",
          "/EHsc",
          "/Fe:",
          "${fileDirname}\\${fileBasenameNoExtension}.exe",
          "${file}",
          "/I",
          "C:\\vcpkg\\installed\\x86-windows\\include"
        ],
        ...
  }
Related