I'm getting the following fatal error while trying to include glib.h into a project. mingw gcc cant find glib.h.
fatal error: glib.h: No such file or directory
I've isolated the issue in a simple helloworld.c file.
Upon Ctrl-Shift-B to build, I get this.
I've also updated my includePath in my c_cpp_properties.json file per the instructions I read here.
Does anyone have any ideas of what I should look into or do to resolve this? I have spent many hours but not made any progress on this. :(
helloworld.c is:
#include <stdio.h>
#include <glib.h>
void main() {
printf("Hello World!");
char c = getchar();
}
c_cpp_properties.json is:
{
"configurations": [
{
"name": "MingGW",
"includePath": [
"${workspaceFolder}/**",
"C:\\cryptolibs\\msys2-64\\mingw64\\include\\glib-2.0",
"C:\\cryptolibs\\msys2-64\\mingw64\\lib\\glib-2.0\\include",
"C:\\cryptolibs\\pbc-0.5.14\\include"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.17763.0",
"compilerPath": "C:\\MinGW\\bin\\g++.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"${workspaceFolder}",
"C:\\cryptolibs\\msys2-64\\mingw64\\include\\glib-2.0",
"C:\\cryptolibs\\msys2-64\\mingw64\\lib\\glib-2.0\\include",
"C:\\cryptolibs\\pbc-0.5.14\\include"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}
launch.json is:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "gcc.exe - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": ""
}
]
}
tasks.json is:
{
"tasks": [
{
"type": "shell",
"label": "C/C++: gcc.exe build active file",
"command": "C:\\MinGW\\bin\\gcc.exe",
"args": ["-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe"],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

