c++ - G++ 警告 : extra tokens at end of#include directive [enabled by default]

标签 c++ g++ warnings

我找不到问题,有人知道解决吗?

代码

#include <algorithm>‎
int main(int argc, char* argv[]) {
    return 0;
}

警告

extra tokens at end of #include directive [enabled by default]

最佳答案

使用 od -c 查看上面引用的代码会得到以下输出:

0000000    #   i   n   c   l   u   d   e       <   a   l   g   o   r   i
0000020    t   h   m   > 342 200 216  \n   i   n   t       m   a   i   n
0000040    (   i   n   t       a   r   g   c   ,       c   h   a   r   *
0000060        a   r   g   v   [   ]   )       {  \n                   r
0000100    e   t   u   r   n       0   ;  \n   }  \n   

注意 >\n 之间的字节:你可能想去掉它们。

关于c++ - G++ 警告 : extra tokens at end of#include directive [enabled by default],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18991984/

相关文章:

在Ubuntu上编译动态链接库并获得无法识别的调试输出级别

iphone - 禁用 Xcode 中特定行中的特定警告

c++ - 通过间接示例解释 C++ 可变性

c++ - 隐藏私有(private)重载虚函数?

c++ - 如何在 ubuntu 14.04 中通过 apt-get 安装以前版本 (4.4.7) 的 gcc/g++?

c++ - 关于-Waggregate-return 的目的/行为的混淆?

c++ - 如何抑制 C++ 中的个别警告?

c++ - 运行时链接错误 : The procedure entry point glewInit@0 could not be located

c++ - 在 C++ 中使用内在函数检查 nans

c++ - 欧拉计划 #16 : Answer 2 digits off