小编Min*_*mel的帖子

在cmake中混合使用C和C++源代码

我正在尝试编译C和C++源代码.目前我通过将此行添加到cmake文件来使用C++ 0x标准的C++ add_definitions(-std=c++0x).

在编译期间,我收到以下警告:cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C [enabled by default]并且此错误:error: ‘for’ loop initial declarations are only allowed in C99 mode在c代码中引用for循环.

我想知道如何在cmake文件中设置c代码的标准.

c c++ cmake c++11

3
推荐指数
1
解决办法
1022
查看次数

标签 统计

c ×1

c++ ×1

c++11 ×1

cmake ×1