【发布时间】:2010-10-08 05:59:12
【问题描述】:
首先,我对 C++ 还是很陌生。我相信getline() 不是标准的C 函数,所以需要#define _GNU_SOURCE 才能使用它。我现在使用 C++,g++ 告诉我 _GNU_SOURCE 已经定义:
$ g++ -Wall -Werror parser.cpp
parser.cpp:1:1: error: "_GNU_SOURCE" redefined
<command-line>: error: this is the location of the previous definition
谁能确认这是标准的,还是它的定义隐藏在我的设置中的某个地方?我不确定最后一行引用的含义。
文件的includes如下,大概是在其中一个或多个中定义的吧?
#include <iostream>
#include <string>
#include <cctype>
#include <cstdlib>
#include <list>
#include <sstream>
谢谢!
【问题讨论】: