I was getting linking errors and had to manually configure MSVC++ ver 6.0 in order for my program to link correctly.
Your linker errors probably came from the fact that when you created a new project, you selected "new console application" instead of "new win32 application". That is why you had to manually configure your project settings.
Secondly, I dont think the code your friend gave you is correct. The /subsystem:windows linker command should be given in both debug and release configurations -- not just debug as your code implies (Unless you might want a console window in release builds for some reason).
Also keep in mind none of these settings are mandatory. You can always have a win32 application which looks like the following:
Code:
#include <windows.h>
#pragma comment (linker, "/ENTRY:mainCRTStartup")
#pragma comment (linker, "/subsystem:windows")
int main(void)
{
HINSTANCE hInst;
hInst = GetModuleHandle(NULL);
MessageBox(NULL,_T("Hello World"),_T("HW"),MB_OK);
return 0;
}
And following the same principals, you can have a console application which looks like:
Code:
#pragma comment (linker, "/ENTRY:WinMainCRTStartup")
#pragma comment (linker, "/subsystem:console")
int PASCAL WinMain(HINSTANCE hi, HINSTANCE hp, LPSTR lpcmd, int nShow)
{
printf("Hello World!\n");
return 0;
}