rr325
rr325

Reputation: 1

Include path for VS_Code

Trying to start a C-program with GTK-library. The IDE pointing that can not find gtk.h and offer to write it in the c_cpp_properties.json.

When I'm doing it - writing it in the "includePath", it says that it can not find the path because it consider the path is relative - IDE tries to look at my program folder instead of consider the path as absolute. How can I point that the path is absolute? Thanks.

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "С:/CodeBlocks/GTK/include/gtk-2.0/gtk"
                
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "c:\\CodeBlocks\\MinGW\\bin\\gcc.exe",
            "cStandard": "c17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "windows-gcc-x86",
            
            }
        }
    ],
    "version": 4
}

The exact message of c_cpp_properties.json is:

Can't find d:\ProgProg\Sheremet_C\C_prog_2\С:\CodeBlocks\GTK\include\gtk-2.0\gtk.

The error mesage in program file:

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (D:\ProgProg\Sheremet_C\C_prog_2\main.c).C/C++(1696)cannot open source file "gtk/gtk.h"C/C++(1696)".

My VS Code is installed under C:, the workspace folder is under D:, and my GTK is under C:.

Upvotes: 0

Views: 106

Answers (1)

Lake
Lake

Reputation: 37

"С:/CodeBlocks/GTK/include/gtk-2.0/gtk" is not in the correct format.

It should be: "С:\\CodeBlocks\\GTK\\include\\gtk-2.0\\gtk"

Upvotes: 0

Related Questions