小编kor*_*ish的帖子

使用-std = c ++ 0x标志进行编译时,Unix宏变为未定义

使用-std = c ++ 0x标志编译下面的代码时,unix宏变为未定义且错误"Unix未定义!" 显示.是否有任何理由发生这种情况以及如何解决这个问题?在gcc版本4.7.2和4.8.4中验证.

#include <iostream>

#if !defined(unix)
#error Unix is not defined!
#endif

int main()
{
    std::cout << "Hello World!" << std::endl;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++ gcc

0
推荐指数
1
解决办法
72
查看次数

标签 统计

c++ ×1

gcc ×1