FLTK g++编译错误
我有一个在视觉工作室中完成的 FLTK 项目,它编译得非常好。但是当我使用 g++ 编译它时,它给了我这个错误:
Undefined first referenced
symbol in file
_ZN4ROMS9ROMS_Menu24read_recipes_ingredientsE6String /var/tmp//ccWVvonz.o
_ZN4ROMS9ROMS_Menu12read_catprdsE6String /var/tmp//ccWVvonz.o
_ZN4ROMS9ROMS_Menu11Read_ordersE6String /var/tmp//ccWVvonz.o
ld: fatal: Symbol referencing errors. No output written to a.out
我正在使用带有以下说明的 shell 文件来编译我的项目:
/opt/csw/gcc4/bin/g++ -Wno-deprecated -I/opt/csg/include main.cpp Graph.cpp GUI.cpp
Window.cpp -L/opt/csw/gcc4/lib/libstdc++.a:/opt/csg/lib -lX11
/opt/csw/lib/libjpeg.so.62 /opt/csg/lib/libfltk.a /opt/csg/lib/libfltk_images.a
再次在 VS 中编译正常,但在 g++ 中出现问题。我什至不明白这个错误,感谢任何帮助,谢谢。如果需要,将发布任何代码。
I have an FLTK project that I finished in visual studios and it compiles absolutely fine. But when I use g++ to compile it it gives me this error:
Undefined first referenced
symbol in file
_ZN4ROMS9ROMS_Menu24read_recipes_ingredientsE6String /var/tmp//ccWVvonz.o
_ZN4ROMS9ROMS_Menu12read_catprdsE6String /var/tmp//ccWVvonz.o
_ZN4ROMS9ROMS_Menu11Read_ordersE6String /var/tmp//ccWVvonz.o
ld: fatal: Symbol referencing errors. No output written to a.out
I'm using a shell file with the following instructions to compile my project:
/opt/csw/gcc4/bin/g++ -Wno-deprecated -I/opt/csg/include main.cpp Graph.cpp GUI.cpp
Window.cpp -L/opt/csw/gcc4/lib/libstdc++.a:/opt/csg/lib -lX11
/opt/csw/lib/libjpeg.so.62 /opt/csg/lib/libfltk.a /opt/csg/lib/libfltk_images.a
Again compiles fine in VS but problems in g++. I don't even understand the error, any help is appreciated, thanks. Will post any code if needed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
未定义符号意味着您通过引用声明进行编译,但链接器找不到定义。
我也不完全确定我从消息中看到的是什么。要么是您缺少 ROM 中的符号,要么是它们被引用的地方。
猜测破坏...
您可能没有包含文件?
Undefined symbol means that you compiled by referencing a declaration, but the linker could not find the definition.
I'm not entirely sure what I'm looking at either from the message. Either you are missing the symbols in ROMS or that is where they were referenced.
Guessing at the demangling...
You may not have included a file?