Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Linking the SFML using Conan on Linux  (Read 370 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Personal Website
    • Email
Linking the SFML using Conan on Linux
« on: November 24, 2019, 05:28:30 am »

I'm trying to use the SFML with Conan so I have a conanfile that looks like that:


And the following cmake:
cmake_minimum_required(VERSION 3.1)


    SET(CMAKE_CXX_FLAGS "/W4 /EHsc /std:c++17")
    SET(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++17 -L.")
file(GLOB_RECURSE SRCS "src/*.cpp")
include_directories(inc build/irrKlang/include)
add_executable(${PROJECT_NAME} ${SRCS})
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} IrrKlang)
I'm launching it this way:
mkdir -p build                  
cd build
conan remote add SFML https://api.bintray.com/conan/bincrafters/public-conan
set -e
conan install .. --build=missing
cmake ..
cmake --build . --config RELEASE
On Windows it's working fine but on Linux I have the following error:
undefined reference to `sf::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::locale const&)'
I saw on the tutorial that I may have to link the SFML with -lsfml-graphics -lsfml-window -lsfml-system but since it's installed with Conan I don't know the path to use -L

Would someone please know how I can link the SFML on Linux with conan?


  • SFML Team
  • Hero Member
  • *****
  • Posts: 9573
    • View Profile
    • development blog
    • Email
Re: Linking the SFML using Conan on Linux
« Reply #1 on: November 24, 2019, 01:31:31 pm »
I think this is more related to the ABI change for strings. You'd need to make sure that SFML is also built with the C++17 flag.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/