2

I'm trying to build an application using CMake. The library I'm trying to use is SFML. Ubuntu is my operating system of choice.

This is my CMakeLists.txt ("//" comments not part of actual file):

project(MyApp)          // App name
cmake_minimum_required(VERSION 2.8)      // CMake version
aux_source_directory(. SRC_LIST)         // Source files
add_executable(${PROJECT_NAME} ${SRC_LIST})         // Executable
target_compile_features(${PROJECT_NAME} PRIVATE cxx_range_for)    // C++ version taken care of

set(CMAKE_MODULE_PATH "/usr/local/share/SFML/cmake/Modules" ${CMAKE_MODULE_PATH})          // Path to my "FindSML.cmake" file
find_package(SFML 2 REQUIRED system window graphics network audio)          // Finding SFML 2.X

#LINKING
target_link_libraries(${PROJECT_NAME}        // Linking libraries
${SFML_LIBRARIES} )             // Linking SFML

These are the errors I get:

error: SerIDE: hidden symbol `__cpu_model' in /usr/lib/gcc/x86_64-linux-gnu/5/libgcc.a(cpuinfo.o) is referenced by DSO
error: final link failed: Bad value
error: collect2: error: ld returned 1 exit status
Simon Hyll
  • 3,265
  • 3
  • 24
  • 44
  • Looks like either SFML library or your executable attempts to use symbol hidden from linking. See [this question](http://stackoverflow.com/questions/23696585/what-does-exactly-the-warning-mean-about-hidden-symbol-being-referenced-by-dso) for more info about that error. – Tsyvarev May 23 '16 at 08:09
  • I can confirm this bug - I compile my program with command line `g++ --std=c++11 -Wall main.cpp -lsfml-graphics -lsfml-window -lsfml-system -o a.out` – FreelanceConsultant Aug 02 '16 at 14:41
  • http://en.sfml-dev.org/forums/index.php?topic=20394.0 – FreelanceConsultant Aug 02 '16 at 14:42

1 Answers1

0

I just updated my Debian Sid, which brought in g++ version 6.1.1. Recompiling SFML appears to have fixed the bug.

There also appears to be a patch if that wont work: http://en.sfml-dev.org/forums/index.php?topic=20638.0