On 13.03.2013 10:32, Mirko D. Comparetti wrote:
...
> 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.

Please read the file README.CMake.txt, particularly the part about
using FLTK with CMake. If you know how to work with CMake, you should
understand what you need, but I can't say what it is. I can only guess
that $(FLTK_LINKLIBRARIES) is not correct, since in the example given
in this file you can read:

target_link_libraries(hello fltk)

and later, why the name "fltk" is chosen and more...

If this doesn't help, please try to post the linker command and
information about your OS (and version), FLTK version, and build
system (e.g. MinGW on Windows?).

Albrecht

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

Reply via email to