0

I downloaded ncurses through msys64 then tried to include it in my source file as #include <ncurses.h>, then it didn't work so I tried changing the c_cpp_properties.json file

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:\\msys64\\mingw64\\include",
                "C:\\MinGW\\include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "C:\\MinGW\\bin\\g++.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "windows-gcc-x64"
        }
    ],
    "version": 4
}

the error persisted, what am I doing wrong

not sure what am I doing wrong, help is appreciated

  • I wonder how much time was already burned trying to get everything to work, here? It took me less than two hours, last time, to install Linux from scratch. I got: ncurses and all other common libraries already installed; the latest version of gcc; a bunch of editors to choose from, vi, emacs; and absolutely no need to fiddle with any arcane JSON configuration files in order to get everything to work together. – Sam Varshavchik Nov 03 '22 at 12:47
  • `"C:\\MinGW\\bin\\g++.exe",` is wrong for msys2 – drescherjm Nov 03 '22 at 13:08
  • Did you also edit your `tasks.json`? You may want to start at the official tutorial to understand and properly setup the 3 important json files: [https://code.visualstudio.com/docs/cpp/config-mingw](https://code.visualstudio.com/docs/cpp/config-mingw) – drescherjm Nov 03 '22 at 13:10
  • This file only helps with linting/Intellisense. You want to look into a build system. – sweenish Nov 03 '22 at 13:44

1 Answers1

0

i solved this problem in my vscode but i use linux, maybe this can be useful for you: I inserted in the file "tasks.json", in the category args (cpp compiler argument) the option "** - I **", where I could define where my library is:

{
 "tasks": [
    {
        "type": "cppbuild",
        "label": "C/C++: g++ compila il file attivo",
        "command": "/usr/bin/g++",
        "args": [
            "-fdiagnostics-color=always",
            "-I", //option of the compiler for set the library folder
            "/usr/local/include/png++-0.2.10/", //patch to the library folder
            "-g",
            "${file}",
            "-o",
            "${fileDirname}/${fileBasenameNoExtension}"
        ],
        "options": {
            "cwd": "${fileDirname}"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": {
            "kind": "build",
            "isDefault": true
        },
        "detail": "Attività generata dal debugger."
    }
],
"version": "2.0.0"  
  }

this will probably help you