1

I'm complety despairing compiling my C++ program using Gtkmm3.. I read about 30 different Stackoverflow, Microsoft and other forum entries but nothing works. The problems were: Using vcpkg doesn't work since I need Gtkmm3 not 4. Using VS Studio fails to generate the cache. Using VS Code doesn't find gtkmm.h (see error message in the title) although I did EVERYTHING this page told me to do: https://wiki.gnome.org/Projects/gtkmm/MSWindows several times in several folders. And of course I have set the right Path in the Windows settings.

The compiler used (terminal told me) is in: D:\msys64\mingw64\bin\g++.exe

I also edited the launch.json with:

{
    "version": "0.2.1",
    "tasks": [
    {
      "taskName": "build-all",
      "appliesTo": "example.cpp",
      "contextType": "build",
      "type": "launch",
      "command": "${env.comspec}",
      "args": [
        "g++ -std=c++17 -o example.exe -g example.cpp simple `pkg-config gtkmm-3.0 --cflags --libs`"
      ]
    }
  ]
} 

I also tried compiling the .exe with Clion with standard CMakeLists.txt I wrote but that doesn't work as well cause Clion can't find either pkgConfig or gtkmm.h.

I tried CodeBlocks with specific Path setting to MinGW.

Someone on StackOverflow wrote a script for installing Gtkmm3 using MinGW in the terminal (Can't find the link for now sorry)... But of course: It didn't work!

So after almost infinity attemps, 4-5 days of trying I gave up now. Hopefully someone can help me here having the same problem.

  • You can provide `includePath` in your [cpp properties](https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference) so the compiler knows where to find your gtkmm header – Cory Kramer Jun 03 '21 at 14:47
  • @CoryKramer that'll only fix intellisense issues – Alan Birtles Jun 03 '21 at 15:02
  • Have you checked that `pkg-config` is working and returning the correct flags? – Alan Birtles Jun 03 '21 at 15:02
  • Entering pkg-config in cmd throws 'Please specify at least one package name on the command line.' back, so it should be installed. Or how do I check that inside VS Code? – Fourierer321 Jun 03 '21 at 15:23
  • Ok, after setting up everything new, now I have this error left: Cannot open the source "glibmmconfig.h" (dependency of gtkmm.h), so I opened the includes folder to add it to the includePath but I couldn't find it. Where is it? @AlanBirtles – Fourierer321 Jun 03 '21 at 19:30
  • I imagine it should be generated by/part of your gtkmm install. see https://stackoverflow.com/questions/21236658/gtk3-developing-on-windows – Alan Birtles Jun 03 '21 at 19:55

0 Answers0