窗户上的gtkmm; &quot“ pkg-config gtkmm-4.0 - flags - libs”获取路径,但是=>致命错误:GTKMM.H:没有这样的文件或目录
要手动编译我目前使用Windows Power Shell。 我认为,PAHT是对的:
pkg-config gtkmm-4.0 --cflags --libs
-IC:/msys64/mingw64/bin/../include/gtkmm-4.0 -IC:/msys64/mingw64/bin/../lib/gtkmm-4.0/include -IC:/msys64/mingw64/bin/../include/giomm-2.68 -IC:/msys64/mingw64/bin/../lib/giomm-2.68/include -IC:/msys64/mingw64/bin/../include -IC:/msys64/mingw64/bin/../include/glib-2.0 -IC:/msys64/mingw64/bin/../lib/glib-2.0/include -IC:/msys64/mingw64/bin/../include/glibmm-2.68 -IC:/msys64/mingw64/bin/../lib/glibmm-2.68/include -IC:/msys64/mingw64/bin/../include/sigc++-3.0 -IC:/msys64/mingw64/bin/../lib/sigc++-3.0/include -IC:/msys64/mingw64/bin/../include/gtk-4.0 -IC:/msys64/mingw64/bin/../include/pango-1.0 -IC:/msys64/mingw64/bin/../include/harfbuzz -IC:/msys64/mingw64/bin/../include/freetype2 -IC:/msys64/mingw64/bin/../include/libpng16 -IC:/msys64/mingw64/bin/../include/fribidi -IC:/msys64/mingw64/bin/../include/cairo -IC:/msys64/mingw64/bin/../include/lzo -IC:/msys64/mingw64/bin/../include/pixman-1 -IC:/msys64/mingw64/bin/../include/gdk-pixbuf-2.0 -IC:/msys64/mingw64/bin/../include/graphene-1.0 -IC:/msys64/mingw64/bin/../lib/graphene-1.0/include -mfpmath=sse -msse -msse2 -IC:/msys64/mingw64/bin/../include/cairomm-1.16 -IC:/msys64/mingw64/bin/../lib/cairomm-1.16/include -IC:/msys64/mingw64/bin/../include/pangomm-2.48 -IC:/msys64/mingw64/bin/../lib/pangomm-2.48/include -mms-bitfields -LC:/msys64/mingw64/bin/../lib -lgtkmm-4.0 -lgtk-4 -lpangowin32-1.0 -lcairo-gobject -lgraphene-1.0 -lpangomm-2.48 -lgiomm-2.68 -lgio-2.0 -lglibmm-2.68 -lcairomm-1.16 -lsigc-3.0 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl
PS
C:\msys64\mingw64\include\gtkmm-4.0> ls
Directorio: C:\msys64\mingw64\include\gtkmm-4.0
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 29/03/2022 18:21 gdkmm
d----- 29/03/2022 18:21 gtkmm
-a---- 22/03/2022 10:36 1914 gdkmm.h
-a---- 22/03/2022 10:36 10091 gtkmm.h
但是,当我尝试编译示例程序时,我会收到下一个错误:
C:\Programacion\gtk\cmake_test> g++ $(pkg-config gtkmm-4.0 --cflags --libs) base.cc -o simple
base.cc:1:10: fatal error: gtkmm.h: No such file or directory
1 | #include <gtkmm.h>
| ^~~~~~~~~
compilation terminated.
就像G ++无法访问路径。
我该怎么办?
提前致谢
to manually compile I use at the moment the Windows Power shell.
The pahts are right, I think:
pkg-config gtkmm-4.0 --cflags --libs
-IC:/msys64/mingw64/bin/../include/gtkmm-4.0 -IC:/msys64/mingw64/bin/../lib/gtkmm-4.0/include -IC:/msys64/mingw64/bin/../include/giomm-2.68 -IC:/msys64/mingw64/bin/../lib/giomm-2.68/include -IC:/msys64/mingw64/bin/../include -IC:/msys64/mingw64/bin/../include/glib-2.0 -IC:/msys64/mingw64/bin/../lib/glib-2.0/include -IC:/msys64/mingw64/bin/../include/glibmm-2.68 -IC:/msys64/mingw64/bin/../lib/glibmm-2.68/include -IC:/msys64/mingw64/bin/../include/sigc++-3.0 -IC:/msys64/mingw64/bin/../lib/sigc++-3.0/include -IC:/msys64/mingw64/bin/../include/gtk-4.0 -IC:/msys64/mingw64/bin/../include/pango-1.0 -IC:/msys64/mingw64/bin/../include/harfbuzz -IC:/msys64/mingw64/bin/../include/freetype2 -IC:/msys64/mingw64/bin/../include/libpng16 -IC:/msys64/mingw64/bin/../include/fribidi -IC:/msys64/mingw64/bin/../include/cairo -IC:/msys64/mingw64/bin/../include/lzo -IC:/msys64/mingw64/bin/../include/pixman-1 -IC:/msys64/mingw64/bin/../include/gdk-pixbuf-2.0 -IC:/msys64/mingw64/bin/../include/graphene-1.0 -IC:/msys64/mingw64/bin/../lib/graphene-1.0/include -mfpmath=sse -msse -msse2 -IC:/msys64/mingw64/bin/../include/cairomm-1.16 -IC:/msys64/mingw64/bin/../lib/cairomm-1.16/include -IC:/msys64/mingw64/bin/../include/pangomm-2.48 -IC:/msys64/mingw64/bin/../lib/pangomm-2.48/include -mms-bitfields -LC:/msys64/mingw64/bin/../lib -lgtkmm-4.0 -lgtk-4 -lpangowin32-1.0 -lcairo-gobject -lgraphene-1.0 -lpangomm-2.48 -lgiomm-2.68 -lgio-2.0 -lglibmm-2.68 -lcairomm-1.16 -lsigc-3.0 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl
PS
C:\msys64\mingw64\include\gtkmm-4.0> ls
Directorio: C:\msys64\mingw64\include\gtkmm-4.0
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 29/03/2022 18:21 gdkmm
d----- 29/03/2022 18:21 gtkmm
-a---- 22/03/2022 10:36 1914 gdkmm.h
-a---- 22/03/2022 10:36 10091 gtkmm.h
But when I try tho compile the example program, I get the next error:
C:\Programacion\gtk\cmake_test> g++ $(pkg-config gtkmm-4.0 --cflags --libs) base.cc -o simple
base.cc:1:10: fatal error: gtkmm.h: No such file or directory
1 | #include <gtkmm.h>
| ^~~~~~~~~
compilation terminated.
It's like g++ doesn't have access to paths.
What could I do to fix it?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已解决:PowerShell不会以Unix样式加以串联,因此G ++与$(pkg-config gtkmm-4.0-cflags - libs)不合适,
它可以通过msys2-mingw x64 shell工作,但是正确命令是。
现在应该与Cmake一起使用,但这是另一个故事...
SOLVED: The powershell doesn't concatenate the commands in unix style, so g++ doesn't work together with $(pkg-config gtkmm-4.0 --cflags --libs)
It works through the msys2-mingw x64 shell, but the right command is.
now should it works together with CMake, but that is another story...