窗户上的gtkmm; &quot“ pkg-config gtkmm-4.0 - flags - libs”获取路径,但是=>致命错误:GTKMM.H:没有这样的文件或目录

发布于 2025-01-21 15:07:08 字数 2466 浏览 0 评论 0原文

要手动编译我目前使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谈情不如逗狗 2025-01-28 15:07:08

已解决:PowerShell不会以Unix样式加以串联,因此G ++与$(pkg-config gtkmm-4.0-cflags - libs)不合适,

它可以通过msys2-mingw x64 shell工作,但是正确命令是。

g++ base.cc -o base $(pkg-config gtkmm-4.0 --cflags --libs)

现在应该与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.

g++ base.cc -o base $(pkg-config gtkmm-4.0 --cflags --libs)

now should it works together with CMake, but that is another story...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文