我正在尝试使用CMake构建应用程序。我试图使用的库是SFML。 Ubuntu是我的首选操作系统。
这是我的CMakeLists.txt(“//”评论不属于实际文件):
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
这些是我得到的错误:
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
答案 0 :(得分:0)
我刚刚更新了我的Debian Sid,它引入了g ++版本6.1.1。重新编译SFML似乎修复了这个错误。
如果不起作用,似乎还有补丁: http://en.sfml-dev.org/forums/index.php?topic=20638.0