开发者

Eclipse gives an error 'Function 'MessageBoxA' could not be resolved' but still compiles successfully?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜