#353 LD error with FLTK on a 64 bits system

open
stage (111)
5
2012-12-16
2011-03-10
brice
No

$ cmake ..
-- Stage version 4.0.1
-- Operating system is Linux
-- Linux x86_64 Detected
-- Installing Libraries to /usr/local/lib64
-- Installing Plugins to /usr/local/lib64/Stage-4.0
-- Build type RELEASE
-- Checking for libtool
-- Checking for required libraries...
-- * FLTK version 1.1.10 detected via /usr/bin/fltk-config
-- FLTK_CFLAGS = -I/usr/include/freetype2 -D_THREAD_SAFE -D_REENTRANT
-- FLTK_LDFLAGS = -lfltk_images -lfltk_gl -lfltk
-- FLTK_LIBS = /usr/lib/libfltk.a /usr/lib/libfltk_gl.a /usr/lib/libfltk_images.a
-- Checking for optional libraries...
-- * Player version 3.1.0-svn detected at /usr/local
-- PLAYER_CFLAGS: -I/usr/local/include/player-3.1
-- PLAYER_LDFLAGS: -L/usr/local/lib64;-lplayercore;-lpthread;-lplayerinterface;-lplayercommon
-- Installation path CMAKE_INSTALL_PREFIX=/usr/local
-- Configuring libstage
-- Looking for Avon
-- checking for one of the modules 'avon'
-- * Avon not detected. If Avon is installed but not detected, check your PKG_CONFIG_PATH.
-- Configuring libstageplugin
-- Configuring done
-- Generating done
-- Build files have been written to: /media/data/playerstage/stage/build

$ make
[ 58%] Built target stage
Linking CXX executable stage
/usr/bin/ld: CMakeFiles/stagebinary.dir/main.o: undefined reference to symbol 'Fl::run()'
/usr/bin/ld: note: 'Fl::run()' is defined in DSO /usr/lib64/libfltk.so.1.1 so try adding it to the linker command line
/usr/lib64/libfltk.so.1.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [libstage/stage] Error 1
make[1]: *** [libstage/CMakeFiles/stagebinary.dir/all] Error 2
make: *** [all] Error 2

Discussion

  • brice
    brice
    2011-03-11

    uncommenting line 88 in libstage/CMakeLists.txt
    set_target_properties( stagebinary PROPERTIES LINK_FLAGS "${FLTK_LDFLAGS}" )
    seems to solve the problem...