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

CMake Error& Compile Error in Centos 7 #1

Open
ChrisZhangJin opened this issue Jan 20, 2020 · 1 comment
Open

CMake Error& Compile Error in Centos 7 #1

ChrisZhangJin opened this issue Jan 20, 2020 · 1 comment

Comments

@ChrisZhangJin
Copy link

the CMakeList.txt will raise error in Centos 7

project(SimpleDenoise LANGUAGES C) # change to project(SimpleDenoise)

After that, cmake runs OK. but compilation failed.
the C-compilation must comply with C99 stadand, so I added this

set(CMAKE_C_FLAGS "-std=c99")

the C-style compilation errors have gone, however, there is still issue in main.c.
the author uses some object that comes from c++11, so I need to add the c++11 support in the CMakeList.txt too

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

Anyway, it's working now.

@zvezdochiot
Copy link

In Debian Wheezy, the original CMakeList.txt does not work. Only works:

cmake_minimum_required(VERSION 2.8)
project(SimpleDenoise LANGUAGES C)

add_definitions(-std=c99 -D_POSIX_C_SOURCE=199309L)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(CMAKE_BUILD_TYPE "Release")

include_directories(include)
add_executable(${PROJECT_NAME} main.c)

target_link_libraries(${PROJECT_NAME} -lm -lrt)

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