无法在Fedora Eclipse上构建GTK+ Windows应用程序
Can not build GTK+ Windows application on Fedora Eclipse
我尝试用MinGW在Fedora x64 Eclipse上为Windows x86构建一个非常简单的应用程序。应用程序编译好了,但是,它不能链接。我的链接命令如下:
i686-w64-mingw32-g++ `mingw32-pkg-config --libs gtk+-2.0` -o "GtkTest" ./main.o
当我运行mingw32-pkg-config——libs gtk+-2.0时,输出如下:
-Wl,-luuid -L/usr/i686-w64-mingw32/sys-root/mingw/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -latk-1.0 -lpangocairo-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32 -lfreetype -lfontconfig -lpango-1.0 -lm -lcairo -lgobject-2.0 -lglib-2.0 -lintl
毫无疑问文件夹和库文件是存在的。但是,我收到以下错误:
./main.o:main.cpp:(.text.startup+0x3e): undefined reference to `gtk_init_abi_check'
./main.o:main.cpp:(.text.startup+0x43): undefined reference to `gtk_builder_new'
./main.o:main.cpp:(.text.startup+0x3d): undefined reference to `gtk_builder_add_from_file'
./main.o:main.cpp:(.text.startup+0x46): undefined reference to `gtk_widget_get_type'
./main.o:main.cpp:(.text.startup+0x58): undefined reference to `gtk_builder_get_object'
./main.o:main.cpp:(.text.startup+0x64): undefined reference to `g_type_check_instance_cast'
./main.o:main.cpp:(.text.startup+0x76): undefined reference to `gtk_builder_connect_signals'
./main.o:main.cpp:(.text.startup+0x86): undefined reference to `g_type_check_instance_cast'
./main.o:main.cpp:(.text.startup+0x8e): undefined reference to `g_object_unref'
./main.o:main.cpp:(.text.startup+0x96): undefined reference to `gtk_widget_show'
./main.o:main.cpp:(.text.startup+0x9b): undefined reference to `gtk_main'
./main.o:main.cpp:(.text.startup+0xcb): undefined reference to `g_log'
./main.o:main.cpp:(.text.startup+0xd7): undefined reference to `g_free'
所以,看起来链接器根本看不到库,即使它们存在并且我在命令行中引用它们。原因是什么?
您缺少顺序错误。查看Tor Lillqvist关于正确标记排序的建议--cflags
,但最重要的是,
相关文章:
- C++为构建时间获取QDateTime的可靠方法
- 无法在 CLion 中构建 C++ 项目
- 函数向量_指针有不同的原型,我可以构建一个吗
- 如何使用ndk-build.cmd构建Android.so文件
- 如何在运行中期切换GTK CSS style_context
- libssh 的函数在构建 libssh 时无法在 Qt 和 cmake 错误中找到
- 使用cmake从源代码构建MySQL连接器/C++失败(与以前的声明冲突)
- VSCode-有一个红色下划线,但程序构建和运行正确,并且出现配音错误
- 构建可组合有向图(扫描仪生成器的汤普森构造算法)
- 如何在GTK程序运行时禁用屏幕保护程序/电源管理/屏幕消隐
- 无法使用Qt Creator在Windows中构建yaml-cpp
- 构建一个由C和C++文件组成的库
- llvm构建器向基本块添加终止符
- FLTK 2.0构建和演示,适用于VS2019的2011年左右的代码库
- 如何跨平台将二进制资源构建到程序中?
- 将 OpenCV 与 CMAKE 中的项目一起构建为第三方库的正确方法
- 如何解决 Ninja c++ 构建和执行问题
- 使用 cmake 的 LLVM 构建在 tsan_libdispatch_mac.cc 期间失败; "Error: conflicting types for ..."
- 如何使用 GTK 3 正确设置默认文本
- 无法在Fedora Eclipse上构建GTK+ Windows应用程序