I've been getting this error for a while now

So I’m not all that far into the course. But until a while ago everything was going swimmingly. I don’t really do anything that isn’t asked of me so I’m confused as to why my code isn’t working.

The code I typed is this:

#include

int main()

{

std::cout << "Hello, World!";

return 0;

}

Whenever I try to compile it I get the next error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include\ostream(707): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
triplex.cpp(4): note: see reference to function template instantiation ‘std::basic_ostream<char,std::char_traits> &std::operator <<<std::char_traits>(std::basic_ostream<char,std::char_traits> &,const char *)’ being compiled

1 Like

That’s the expected output and Gavin gets the same thing, compiling doesn’t execute the program it creates it.

cl triplex.cpp

Will output the executable triplex.exe. You can then just type that to execute the program (you can omit .exe).
You can also silence the warning by compiling with /EHsc

cl triplex.cpp /EHsc
1 Like

Hey man thanks! I was just confused because Gavin immediately got it to work but you were right. Woops my bad.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms