使用 FLTK 框架编译时遇到的问题
我似乎在使用 fltk-config 脚本以外的任何内容编译 FLTK 程序时遇到问题。
我已经从教程中的“Hello world”程序复制了源代码。当我运行 fltk-config --compile hello.cpp 时,它会打印出来
g++ -I/usr/local/include -I/usr/local/include/FL/images -mwindows -DWIN32 -DUSE_OPENGL32 -D_LARGEFILE_SOURCE -D_LARGEFILE32_SOURCE -o 'hello' 'hello.cpp' -mwindows /usr/local/lib/libfltk.a -lole32 -luuid -lcomct132
并编译得很好。但是当我自己打印同样的内容时,它说 ld.exe 找不到 -lcomct132。
我在WinXP下使用MinGW上编译的FLTK 1.3.0。
I seem to have problems compiling FLTK programms using anything other than the fltk-config script.
I have copied the source from the "Hello world" program in the tutorial. When I run fltk-config --compile hello.cpp it prints out
g++ -I/usr/local/include -I/usr/local/include/FL/images -mwindows -DWIN32 -DUSE_OPENGL32 -D_LARGEFILE_SOURCE -D_LARGEFILE32_SOURCE -o 'hello' 'hello.cpp' -mwindows /usr/local/lib/libfltk.a -lole32 -luuid -lcomct132
and compiles just fine. But when I print in the same thing myself, it says, that ld.exe cannot find -lcomct132.
I use FLTK 1.3.0 compiled on MinGW under WinXP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我敢打赌 fltk-config 脚本正在设置您尚未配置的环境变量。检查 FLTK 文档并查看需要设置的正确环境变量,以便在不使用帮助程序脚本的情况下进行编译。
编辑:做了一些研究
显然你不是唯一一个有链接问题的人。我在论坛此处和fltk.general 新闻组。共识似乎是链接参数的顺序很重要,并且使用 fltk-config 脚本是最简单的方法。
I bet that the fltk-config script is setting environment variables that you have not configured. Check the FLTK documentation and see the proper environment variables you need to set to compile without the helper script.
Edit: Did some research
Apparently you're not the only one that has linking problems. I found a similar problem on the forum here and on the fltk.general newsgroup. The consensus seems to be that order of the linking arguments are important, and that using the fltk-config script is the easiest way to proceed.
我没有收到这个特定的错误,但我确实遇到了“lcomct132”的问题。也许你的错误与它有关。所以,就我而言,这就是解决方案:
I didn't get this specific error, but I did have problem with the "lcomct132". Maybe your error has something related to it. So, in my case, here it was the SOLUTION: