开发者

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

开发者 https://www.devze.com 2023-03-30 18:22 出处:网络
While c开发者_JAVA技巧ompile Win32 applications on eclipse using the MinGW toolchain (and Internal Builder), eclipse compiles the following code:

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

精彩评论

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