Can anyone help me with this problem? Basically, I'm trying to call the function 'MessageBoxA' without including windows.h (and by rather linking to 'libuser32.a'). Can this be done?
The following gives me an error ([Linker error] undefined reference to 'MessageBoxA'):
extern "C" int MessageBoxA(int hWnd,const char* lpText,const char* lpCaption,unsigned int uType);
I have already tried adding 'pragma comment(lib, "libuser32.a")'.
Could it be an issue of how I compile it? I have tried it both under Dev-C++ (I included the library under 'Project Options'->'Linker') and under Command Prompt (gcc -Os -s Debug.cpp -luser32).
Thanks in advance!
Note: I am using MinGW as my compiler.