/usr/local/lib/libsfml-window.so: undefined reference to `sf::Clock::Reset()'
/usr/local/lib/libsfml-window.so: undefined reference to `sf::Unicode::UTF8Offsets'
/usr/local/lib/libsfml-window.so: undefined reference to `sf::Clock::Clock()'
/usr/local/lib/libsfml-window.so: undefined reference to `sf::Clock::GetElapsedTime() const'
/usr/local/lib/libsfml-window.so: undefined reference to `sf::Unicode::UTF8TrailingBytes'
/usr/local/lib/libsfml-window.so: undefined reference to `sf::Sleep(float)'
Did you link to sfml-system?
set(CMAKE_MODULE_PATH "../cmake_modules/" ${CMAKE_MODULE_PATH})
find_package(SFML 1.6 REQUIRED system window graphics network audio)
Yes, I do so in my src/CMakeLists.txtNo, you don't. What you do is finding the package, not linking. In CMake, you can link with the command target_link_libraries. The command names are quite expressive, aren't they? ;)Quoteset(CMAKE_MODULE_PATH "../cmake_modules/" ${CMAKE_MODULE_PATH})
find_package(SFML 1.6 REQUIRED system window graphics network audio)
Yes, I do so in my src/CMakeLists.txtNo, you don't. What you do is finding the package, not linking. In CMake, you can link with the command target_link_libraries. The command names are quite expressive, aren't they? ;)Quoteset(CMAKE_MODULE_PATH "../cmake_modules/" ${CMAKE_MODULE_PATH})
find_package(SFML 1.6 REQUIRED system window graphics network audio)
And I recommend to start with SFML 2. It has more features, less bugs and is actively developed.
#SFML lookup
set(CMAKE_MODULE_PATH "../cmake_modules/" ${CMAKE_MODULE_PATH})
find_package(SFML 1.6 REQUIRED system window graphics network audio)
#Executable
add_executable(${exec_name} ${exec_source_files})
#Libraries
set(project_libraries config engine graphics grid input unit util)
set(external_libraries ${SFML_LIBRARIES})
set(libraries ${project_libraries} ${external_libraries})
#Libraries Link
target_link_libraries(${exec_name} ${libraries})
I tought SFML 2 was still in beta?No, there is a release candidate. And you can get the newest sources from GitHub.
I tought SFML 2 was still in beta?No, there is a release candidate. And you can get the newest sources from GitHub.
I suggest you try it with SFML 2, because the 1.x versions were not designed with CMake integration in mind. For example, the FindSFML module has been written for version 2.
I tought SFML 2 was still in beta?No, there is a release candidate. And you can get the newest sources from GitHub.
I suggest you try it with SFML 2, because the 1.x versions were not designed with CMake integration in mind. For example, the FindSFML module has been written for version 2.