Skip to content

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

Open

Description

@smaudet

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.

Activity

  1. ljluestc commented on Sep 5, 2023

    @ljluestc

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions