This very simple program compiles but fails the linker stage.
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(300,180);
Fl_Box *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();
}
/Applications/CLion.app/Contents/bin/cmake/bin/cmake --build /Users/adam/Library/Caches/CLion2016.2/cmake/generated/fltk_test-f06748b0/f06748b0/Debug --target all -- -j 8
Scanning dependencies of target fltk_test
[ 50%] Building CXX object CMakeFiles/fltk_test.dir/main.cpp.o
[100%] Linking CXX executable fltk_test
Undefined symbols for architecture x86_64:
"fl_define_FL_SHADOW_LABEL()", referenced from:
_main in main.cpp.o
"Fl::run()", referenced from:
_main in main.cpp.o
"Fl_Box::Fl_Box(int, int, int, int, char const*)", referenced from:
_main in main.cpp.o
"Fl_Group::end()", referenced from:
_main in main.cpp.o
"Fl_Window::show(int, char**)", referenced from:
_main in main.cpp.o
"Fl_Window::Fl_Window(int, int, char const*)", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [fltk_test] Error 1
make[1]: *** [CMakeFiles/fltk_test.dir/all] Error 2
make: *** [all] Error 2