While c开发者_JAVA技巧ompile Win32 applications on eclipse using the MinGW toolchain (and Internal Builder), eclipse compiles the following code:
#include <windows.h>
int WinMain (HINSTANCE p1, HINSTANCE p2, LPSTR p3, int p4)
{
MessageBox(0, "Hello.", "MyProg", MB_OK);
return 0;
}
But MessageBox is underlined in red, with the error: 'Function 'MessageBoxA' could not be resolved'. The same error is shown for SendMessage(). The program works OK, but I cant figure out why the red line is there. :@
Eclipse can't resolve WinAPI functions. You need to add folders with WinAPI headers (windows.h
) in to Include paths.
精彩评论