fallahn / sfml-tmxloader

SFML 2.x based tmx tilemap parser for files created with Tiled tile map editor
106 stars 33 forks source link

Can't build with SFML 2.3.2 #44

Closed linde12 closed 8 years ago

linde12 commented 8 years ago

I'm not sure if its SFML 2.3.2 that's causing the problem but i get the following issues while trying to build:

17:15:47, /home/linde/repos/sfml-tmxloader, (master) > ls
cmake/  CMakeLists.txt*  examples/  fonts/  include/  lib/  maps/  packages/  README.md  src/
17:15:48, /home/linde/repos/sfml-tmxloader, (master) > mkdir build
17:15:52, /home/linde/repos/sfml-tmxloader, (master) > cd build/
17:15:53, /home/linde/repos/sfml-tmxloader/build, (master) > cmake ..
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- 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
-- 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
-- Found SFML 2.3.2 in /usr/include
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Could NOT find Box2D (missing:  BOX2D_LIBRARIES BOX2D_INCLUDE_DIR) 

-> Box2D directories not found. Set BOX2D_INCLUDE_DIR to Box2D's include path and BOX2D_LIBRARIES to Box2D's lib directory path.
-> Make sure the Box2D libraries with the same configuration (Release/Debug, Static/Dynamic) exist.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/linde/repos/sfml-tmxloader/build
17:15:55, /home/linde/repos/sfml-tmxloader/build, (master) > ls
CMakeCache.txt  CMakeFiles/  cmake_install.cmake  Makefile
17:15:56, /home/linde/repos/sfml-tmxloader/build, (master) > make
Scanning dependencies of target pugi
[  8%] Building CXX object CMakeFiles/pugi.dir/src/pugixml/pugixml.cpp.o
Linking CXX shared library libpugi.so
[  8%] Built target pugi
Scanning dependencies of target tmx-loader
[ 16%] Building CXX object CMakeFiles/tmx-loader.dir/src/DebugShape.cpp.o
[ 25%] Building CXX object CMakeFiles/tmx-loader.dir/src/MapLoaderPublic.cpp.o
[ 33%] Building CXX object CMakeFiles/tmx-loader.dir/src/MapLoaderPrivate.cpp.o
[ 41%] Building CXX object CMakeFiles/tmx-loader.dir/src/MapLayer.cpp.o
[ 50%] Building CXX object CMakeFiles/tmx-loader.dir/src/MapObject.cpp.o
[ 58%] Building CXX object CMakeFiles/tmx-loader.dir/src/QuadTreeNode.cpp.o
Linking CXX shared library libtmx-loader.so
[ 58%] Built target tmx-loader
Scanning dependencies of target BenchMark
[ 66%] Building CXX object CMakeFiles/BenchMark.dir/examples/Benchmark.cpp.o
Linking CXX executable BenchMark
libtmx-loader.so: undefined reference to `sf::Image::~Image()'
libtmx-loader.so: undefined reference to `sf::VertexArray::VertexArray(sf::PrimitiveType, unsigned long)'
libtmx-loader.so: undefined reference to `sf::VertexArray::operator[](unsigned long)'
libtmx-loader.so: undefined reference to `sf::RenderTarget::draw(sf::Vertex const*, unsigned long, sf::PrimitiveType, sf::RenderStates const&)'
collect2: error: ld returned 1 exit status
CMakeFiles/BenchMark.dir/build.make:91: recipe for target 'BenchMark' failed
make[2]: *** [BenchMark] Error 1
CMakeFiles/Makefile2:61: recipe for target 'CMakeFiles/BenchMark.dir/all' failed
make[1]: *** [CMakeFiles/BenchMark.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
17:16:06, /home/linde/repos/sfml-tmxloader/build, (master) > 

Tried on debian jessie x64

fallahn commented 8 years ago

Thanks for the feedback, it seems the failure is in building the examples, not the lib itself. I've just tested this on mint 17, however, using a fresh build of SFML and I can't reproduce the error. It also seems odd that it can't find definitions for functions which certainly exist. Are you perhaps mixing static/shared libs somehow?

linde12 commented 8 years ago

Hello & sorry for the late reply!

I have found the issue & it wasn't with sfml-tmxloader but rather with my SFML-binaries.

I downloaded the SFML 2.3.2 source, compiled & installed then everything worked as expected. Not sure why the precomiled .so files didn't work for me.