Dear all,
I  did the following small test program and I'm experiencing a strange behavior:

- - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - -
//main.cpp
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Output.H>

int main() {

        Fl_Window win(400, 600, "TestWindow");

        win.begin();

        Fl_Output test(50, 50, 300, 500, "Test");

        win.end();
        win.show();
        return Fl::run();

}
- - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - -

If I issue an fltk-config --compile main.cpp everything works and I get the 
working executable file.

If I create this cmake file:

- - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - -
#CMakeList.txt
cmake_minimum_required(VERSION 2.8)

project(test)

find_package(FLTK REQUIRED NO_MODULE)
find_package(OpenGL REQUIRED)


set(test_SRCS
        main.cpp
)

set(test_HDRS
)

add_executable(test ${APPLICATION_EXECUTABLE_SYSTEM} ${test_SRCS} ${test_HDRS})
target_link_libraries(test ${FLTK_LIBRARIES})
target_link_libraries(test ${OPENGL_LIBRARIES})
- - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - -

I can cmake it using the GUI and create the makefile without any problem, but 
when I issue the make command, this is the output error from the linker (and 
not from the compiler):

- - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - -
Linking CXX executable test
CMakeFiles/test.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x5f): undefined reference to `Fl_Output::Fl_Output(int, int, 
int, int, char const*)'
collect2: ld returned 1 exit status
make[2]: *** [test] Error 1
make[1]: *** [CMakeFiles/test.dir/all] Error 2
make: *** [all] Error 2
- - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - - 8< - - - -

Do you know how to solve it? I think I'm missing some dependencies, but I don't 
know which ones.

Thank you, regards

MDC
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to