New to c++. I created a new win32 Application project in Visual Studio I selected "Windows application" and "Empty project.
I added a "write.cpp" file under "Source Files" with following code, then I click Build->build solution and got error:
errorLNK2019 and errorLNK1120.
Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup U:\CreditFIModels\Models\Risk Premia\SB\IGUpdates\PY\src\c++\writeWin32\writeWin32\MSVCRTD.lib(crtexew.obj) writeWin32
Error 2 error LNK1120: 1 unresolved externals U:\CreditFIModels\Models\Risk Premia\SB\IGUpdates\PY\src\c++\writeWin32\Debug\writeWin32.exe 1 1 writeWin32
I've read threads in SO changed General->Common Language Runtime Support->to either /clr:pure or /clr, it doesn't help. My original setting "No Common Language Runtime Support" doesn't work as well.
Hope anyone can help me figure out what is going on.
// basic file operations
#include <iostream>
#include <fstream>
using namespace std;
int main () {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}