Skip to content

ZLib Linking error #19

@sromer

Description

@sromer

Hi,

I am currently trying to build the FIFEngine tutorial, but I am getting stuck at the following error:

sromer@ubuntu:~/Development/cpp-tutorials/src/_build$ cmake ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Set CMAKE_BUILD_TYPE to default 'Release'.

== Building fife-cpp-tutorials using build type 'Release'.
--     Source directory is '/home/sromer/Development/cpp-tutorials/src'.
--     Build  directory is '/home/sromer/Development/cpp-tutorials/src/_build'.
--     Installation path is '/usr/local' (set -DCMAKE_INSTALL_PREFIX=<path> to change).
--     CXX Compiler Flags: ''.
--     Dependencies folder: '/home/sromer/Development/cpp-tutorials/src/../dependencies'.

-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found FIFE: /usr/local/lib/libfife.a (found version "0.4.0") 
-- Found the following FifeChan libraries:
--   fifechan_opengl
--   fifechan_sdl
-- Found FIFECHAN: /usr/local/lib/libfifechan.so   
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   regex
-- Found VORBIS: /usr/lib/x86_64-linux-gnu/libvorbisfile.so  
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.2.54") 
-- Found OGG: /usr/lib/x86_64-linux-gnu/libogg.so  
<FindSDL2.cmake>
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
</FindSDL2.cmake>
-- Found SDL2: /usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so;-lpthread  
-- Found SDL2_image: /usr/lib/x86_64-linux-gnu/libSDL2_image.so (found version "2.0.1") 
-- Found SDL2_ttf: /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so (found version "2.0.14") 
-- Found OpenAL: /usr/lib/x86_64-linux-gnu/libopenal.so  
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so  
-- Found TinyXML: /usr/lib/x86_64-linux-gnu/libtinyxml.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sromer/Development/cpp-tutorials/src/_build
sromer@ubuntu:~/Development/cpp-tutorials/src/_build$ make
Scanning dependencies of target Tutorial1
[ 14%] Building CXX object tutorial_1/CMakeFiles/Tutorial1.dir/MouseListener.cpp.o
[ 28%] Building CXX object tutorial_1/CMakeFiles/Tutorial1.dir/ScreenScroller.cpp.o
[ 42%] Building CXX object tutorial_1/CMakeFiles/Tutorial1.dir/Game.cpp.o
[ 57%] Building CXX object tutorial_1/CMakeFiles/Tutorial1.dir/main.cpp.o
[ 71%] Building CXX object tutorial_1/CMakeFiles/Tutorial1.dir/KeyListener.cpp.o
[ 85%] Building CXX object tutorial_1/CMakeFiles/Tutorial1.dir/ViewController.cpp.o
[100%] Linking CXX executable Tutorial1
/usr/bin/ld: /usr/local/lib/libfife.a(zipsource.cpp.o): undefined reference to symbol 'inflateInit2_'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libz.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
tutorial_1/CMakeFiles/Tutorial1.dir/build.make:268: recipe for target 'tutorial_1/Tutorial1' failed
make[2]: *** [tutorial_1/Tutorial1] Error 1
CMakeFiles/Makefile2:85: recipe for target 'tutorial_1/CMakeFiles/Tutorial1.dir/all' failed
make[1]: *** [tutorial_1/CMakeFiles/Tutorial1.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

I figured libz.so might be missing from my system, but as you can see, CMake is able to find the libz library correctly: Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8"). I have checked if the library is indeed installed and can be found/accessed at the folder in which CMake locates libz and that is the case.

I am running Ubuntu 16.04 LTS (x64).

Hopefully someone can help me out!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions