Hello!! So I just started moving over from Java to C++ and am having problems. All I am trying to do is make a simple MessageBox and when I try to run this code:
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){
MessageBox(NULL,
L"Hello World!",
L"Hello World program",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
it just gives me this error:
main.cpp:7:39: error: cannot convert ‘const wchar_t*’ to ‘LPCSTR {aka const char*}’ for argument ‘2’ to ‘int MessageBoxA(HWND, LPCSTR, LPCSTR, UINT)’
MB_ICONEXCLAMATION | MB_OK);
^`
Any ideas why it might be broke? Thank you!!