I want to use FLTK to make a GUI. So I installed it on my Mac by brewing it. That worked fine so far.
Nevertheless, when I try to compile a small program, I get this error message:
-------------- Build: Debug in fltk_test (compiler: GNU GCC Compiler)---------------
g++ -o bin/Debug/fltk_test obj/Debug/main.o
Undefined symbols for architecture x86_64:
"fl_define_FL_SHADOW_LABEL()", referenced from:
_main in main.o
"Fl::run()", referenced from:
_main in main.o
"Fl_Box::Fl_Box(int, int, int, int, char const*)", referenced from:
_main in main.o
"Fl_Group::end()", referenced from:
_main in main.o
"Fl_Window::show(int, char**)", referenced from:
_main in main.o
"Fl_Window::Fl_Window(int, int, char const*)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Here is my code:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
int main (int argc, char ** argv)
{
Fl_Window *window;
Fl_Box *box;
window = new Fl_Window (300, 180);
box = new Fl_Box (20, 40, 260, 100, "Hello World!");
box->box (FL_UP_BOX);
box->labelsize (36);
box->labelfont (FL_BOLD+FL_ITALIC);
box->labeltype (FL_SHADOW_LABEL);
window->end ();
window->show (argc, argv);
return(Fl::run());
}
Believe me, I searched for more than four hours, tried it with a differente IDE (Atom) and so on and so forth. "Normal" C++ is working properly...
Thanks in advance. I appreciate every tip or help I can get :)