1
General / undefined reference to ...
« on: May 22, 2018, 11:39:14 am »
Hello,
OS: Debian testing
SFML: 2.5.0+dfsg-2
Standard install way: sudo aptitude install libsfml-dev
I have a problem with my project after updating the SFML from 2.4.2 to 2.5.0 version .When I tried to compile it i get an error message::
It's only simple skeleton of project:
OS: Debian testing
SFML: 2.5.0+dfsg-2
Standard install way: sudo aptitude install libsfml-dev
I have a problem with my project after updating the SFML from 2.4.2 to 2.5.0 version .When I tried to compile it i get an error message::
[ 50%] Linking CXX executable LittleHero
CMakeFiles/LittleHero.dir/main.cpp.o: In function `main':
/home/wrona/Code/C++/RPG/LittleHero/main.cpp:9: undefined reference to `sf::String::String(char const*, std::locale const&)'
/home/wrona/Code/C++/RPG/LittleHero/main.cpp:9: undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
/home/wrona/Code/C++/RPG/LittleHero/main.cpp:9: undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
/home/wrona/Code/C++/RPG/LittleHero/main.cpp:9: undefined reference to `sf::RenderWindow::~RenderWindow()'
CMakeFiles/LittleHero.dir/main.cpp.o: In function `main':
/home/wrona/Code/C++/RPG/LittleHero/main.cpp:9: undefined reference to `sf::String::String(char const*, std::locale const&)'
/home/wrona/Code/C++/RPG/LittleHero/main.cpp:9: undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
/home/wrona/Code/C++/RPG/LittleHero/main.cpp:9: undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
/home/wrona/Code/C++/RPG/LittleHero/main.cpp:9: undefined reference to `sf::RenderWindow::~RenderWindow()'
It's only simple skeleton of project:
Code: [Select]
cmake_minimum_required(VERSION 3.10)
project(LittleHero)
set(CMAKE_CXX_STANDARD 11)
add_executable(LittleHero main.cpp)
set(CMAKE_MODULE_PATH "/usr/share/SFML/cmake/Modules/" ${CMAKE_MODULE_PATH})
find_package(SFML 2.5 REQUIRED graphics window system)
if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(LittleHero ${SFML_LIBRARIES} ${SFML_DEPENDENCIES})
endif()
Code: [Select]
#include <iostream>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Window/Event.hpp>
using namespace std;
int main() {
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
window.close();
return 0;
}