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.
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?