FLTK g++编译错误

发布于 2024-12-15 22:32:43 字数 803 浏览 1 评论 0原文

我有一个在视觉工作室中完成的 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 技术交流群。

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

发布评论

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

评论(1

允世 2024-12-22 22:32:43

未定义符号意味着您通过引用声明进行编译,但链接器找不到定义。

我也不完全确定我从消息中看到的是什么。要么是您缺少 ROM 中的符号,要么是它们被引用的地方。

_ZN4ROMS9ROMS_Menu24read_recipes_ingredientsE6String

猜测破坏...

ROMS::ROMS_Menu::read_recipes_ingredients::String

您可能没有包含文件?

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.

_ZN4ROMS9ROMS_Menu24read_recipes_ingredientsE6String

Guessing at the demangling...

ROMS::ROMS_Menu::read_recipes_ingredients::String

You may not have included a file?

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