iostream缺少方法

时间:2012-07-30 01:41:27

标签: c++ iostream mingw-w64

我目前正在尝试做一些简单的IO但是我遇到了一些未解决的方法。

#include <iostream>
#include <fstream>

std::string filename = "\random\location\blah";
std::ifstream test;  // is defined
test.open(filename);  //all others not resolvable
bool doesntwork = test.is_open();
bool alsodoesnt = test.good();
test.close();

我目前正在使用Mingw-w64,我已经检查了MinGW \ lib \ gcc \ x86_64-w64-mingw32 \ 4.7.2 \ include \ c ++ \ fstream,他们在那里为诸如basic_ifstream之类的成员。

(抱歉忘记编译)

c:\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/_mingw_secapi.h:47:8: error: expected unqualified-id before string constant
c:\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/vadefs.h:12:32: error: expected '}' before end of line
c:\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/vadefs.h:12:32: error: expected unqualified-id before end of line
c:\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/vadefs.h:12:32: error: expected declaration before end of line

错误1:

#ifdef __cplusplus
extern "C++" {   // the error location, not sure what to do
template <bool __test, typename __dsttype>
 struct __if_array;
template <typename __dsttype>
struct __if_array <true, __dsttype> {
typedef __dsttype __type;
};
}
#endif /*__cplusplus*/

错误2-4

#ifdef __cplusplus
extern "C" {  //not sure what they wanted here
#endif

0 个答案:

没有答案