configurar o VSCODE para complilar com gtkmm-3.0

1. configurar o VSCODE para complilar com gtkmm-3.0

upuaut-wq
upuaut

(usa Outra)

Enviado em 12/03/2021 - 19:46h

Ola, estou tentando configurar o gtkmm3 para compilar no vs code. A parte de autocomplete fiz a referencia das devidas pastas e esta ok. Não exibe erro. Meu c_cpp_properties.json esta da seguinte forma:

{
"configurations": [
{
"name": "GTKMM",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/glibmm-2.4",
"/usr/include/glib-2.0",
"/usr/include/sigc++-2.0",
"/usr/lib/x86_64-linux-gnu/glib-2.0/include",
"/usr/lib/x86_64-linux-gnu/glibmm-2.4/include",
"/usr/lib/x86_64-linux-gnu/sigc++-2.0/include",
"/usr/include/giomm-2.4",
"/usr/lib/x86_64-linux-gnu/giomm-2.4/include",
"/usr/include/gdkmm-3.0",
"/usr/include/gdkmm-3.0",
"/usr/lib/x86_64-linux-gnu/gdkmm-3.0/include",
"/usr/lib/x86_64-linux-gnu/pangomm-1.4/include",
"/usr/include/gtk-3.0",
"/usr/include/pango-1.0",
"/usr/include/harfbuzz",
"/usr/include/cairo",
"/usr/include/gdk-pixbuf-2.0",
"/usr/include/cairomm-1.0",
"/usr/include/freetype2",
"/usr/include/gtkmm-3.0",
"/usr/lib/x86_64-linux-gnu/gtkmm-3.0/include",
"/usr/include/pangomm-1.4",
"/usr/include/atkmm-1.6",
"/usr/include/atk-1.0"
],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++14",
"intelliSenseMode": "linux-clang-x64",
"compilerArgs": []
}
],
"version": 4
}


Consigo programar e está tudo OK. O problema começa quando tento compilar. Aparece a seguinte mensagem de saída.

[main.cpp 2021-03-12 22:22:07.844]
,,In file included from main.cpp:1:
/usr/include/gtkmm-3.0/gtkmm.h:87:10: fatal error: glibmm.h: Arquivo ou diretório inexistente
87 | #include <glibmm.h>
| ^~~~~~~~~~
compilation terminated.


Se eu rodar a opção Run Task... no menu Terminal do VS code aparece isso.

> Executing task: C/C++: g++ arquivo de build ativo <

Iniciando o build...
/usr/bin/g++ -g "/home/user/Área de Trabalho/vsc/main.cpp" -o "/home/user/Área de Trabalho/vsc/main"
In file included from /home/user/Área de Trabalho/vsc/main.cpp:1:
/usr/include/gtkmm-3.0/gtkmm.h:87:10: fatal error: glibmm.h: Arquivo ou diretório inexistente
87 | #include <glibmm.h>
| ^~~~~~~~~~
compilation terminated.

Build concluído com erros.
The terminal process failed to launch (exit code: -1).

Terminal will be reused by tasks, press any key to close it.


Tentei colocar essa linha no tasks.json.

pkg-config gtkmm-3.0 --cflags --libs 


porém o erro permanece.
Se eu rodar
echo $(pkg-config gtkmm-3.0 --cflags --libs)
, no terminal aparece isso, logo creio que o gtkmm esta instaldo bem como suas dependencias.
-pthread -I/usr/include/gtkmm-3.0 -I/usr/lib/x86_64-linux-gnu/gtkmm-3.0/include -I/usr/include/atkmm-1.6 -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib/x86_64-linux-gnu/gdkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib/x86_64-linux-gnu/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/x86_64-linux-gnu/pangomm-1.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/x86_64-linux-gnu/glibmm-2.4/include -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/cairomm-1.0 -I/usr/lib/x86_64-linux-gnu/cairomm-1.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/sigc++-2.0 -I/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lgio-2.0 -lcairomm-1.0 -lcairo -lsigc-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0


OBS: EU CONSIGO COMPILAR UM ARQUIVO UTILIZANDO ESSE COMANDO
g++ teste.cpp -o teste `pkg-config gtkmm-4.0 --cflags --libs`
.


Alguem utiliza o gtkmm com visual code. Perdi horas tentando funcionar, busquei em varios locais, porem não funciona. Se alguem tiver uma dica agradeço.



  






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts