Warnings as errors causing gcc 10 to fail to compile.
Opened this issue · 1 comments
smaudet commented
Line 30 in CMakelists.txt
:
set(C_CXX_FLAGS "-Wall -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -ggdb -fvisibility=hidden")
is causing the library to fail to compile on a recent kernel and gcc version.
Setting to:
set(C_CXX_FLAGS "-Wall -Wformat=2 -Wsign-compare -Wmissing-field-initializers -ggdb -fvisibility=hidden")
i.e. removing -Werror
allows for compilation to proceed.
ljluestc commented
cmake_minimum_required(VERSION 3.0)
project(YourProjectName)
set(CMAKE_CXX_STANDARD 11)
Set your compiler flags without -Werror
set(C_CXX_FLAGS "-Wall -Wformat=2 -Wsign-compare -Wmissing-field-initializers -ggdb -fvisibility=hidden")
Add your source files here
add_executable(your_executable main.cpp)
Apply the compiler flags
target_compile_options(your_executable PRIVATE ${C_CXX_FLAGS})