Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings as errors causing gcc 10 to fail to compile. #44

Open
smaudet opened this issue Oct 19, 2020 · 1 comment
Open

Warnings as errors causing gcc 10 to fail to compile. #44

smaudet opened this issue Oct 19, 2020 · 1 comment

Comments

@smaudet
Copy link

smaudet commented Oct 19, 2020

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
Copy link

ljluestc commented Sep 5, 2023

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})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants