I've just downloaded and installed Visual C++ Toolkit 2003, I found that every time I compile, I need to use "/EHsc" option. I've used the "/?" to get the help, but I still cannot understand what it for. I've the following code:
And I compile with "cl /EHsc test.cpp", but got the following error:
Code:
#include <fstream>
using namespace std;
int main() {
ifstream f("data.txt", ios_base::in | ios_base::nocreate);
return 0;
}
Code:
test.cpp(5) : error C2039: 'nocreate' : is not a member of 'std::ios_base'
C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\xiosbase(181)
: see declaration of 'std::ios_base'
test.cpp(5) : error C2065: 'nocreate' : undeclared identifier
test.cpp(5) : error C2676: binary '|' : 'const std::_Iosb<_Dummy>::_Openmode' do
es not define this operator or a conversion to a type acceptable to the predefin
ed operator
with
[
_Dummy=int
]