Eclipse 给出错误"无法解析函数'MessageBoxA'",但仍然成功编译?
Eclipse gives an error 'Function 'MessageBoxA' could not be resolved' but still compiles successfully?
使用MinGW工具链(和Internal Builder)在eclipse上编译Win32应用程序时,eclipse编译以下代码:
#include <windows.h>
int WinMain (HINSTANCE p1, HINSTANCE p2, LPSTR p3, int p4)
{
MessageBox(0, "Hello.", "MyProg", MB_OK);
return 0;
}
但是MessageBox用红色下划线,并显示错误:'Function 'MessageBoxA' cannot be resolved'。SendMessage()显示了相同的错误。程序工作正常,但我不明白为什么红线在那里。: @
Eclipse无法解析WinAPI函数。您需要添加带有WinAPI头(windows.h
)的文件夹到Include paths.
相关文章:
- VS2017 版本 15.8.3 成功编译内联方法,而不返回所需值
- 如何在 c++ 中导入文件?以及如何成功编译它们?
- 奇怪的语法构造 - 应用于 typedef 的运算符 () 使用 VS2015 成功编译
- "template"关键字限定符是否会导致代码成功编译,但不同?
- 使用不带前缀"std"且不带"using namespace std;"的 std::sort() 成功编译
- 在 C++11 和 C++11 之前成功编译但行为不同的代码示例
- 有没有人在Windows7机器上成功编译过木瓜
- CGAL:如何成功编译和链接CGAL示例(在Mac OS X 10.9 Mavericks上)
- 使用 qmake 成功编译 SSE 指令(但 SSE2 不被识别)
- Socket C++程序在运行时成功编译崩溃
- 在 clang 中显式指定的参数无效,但在 gcc 中成功编译 — 谁错了?
- 为什么这个模板函数能够成功编译
- 无法使用Xcode成功编译boost
- Eclipse可以成功编译,但仍然会出现语义错误
- 成功编译节点模块并"Module did not self-register."
- Eclipse 给出错误"无法解析函数'MessageBoxA'",但仍然成功编译?
- C++ 成功编译,不包含<string>标题
- CGAL4.6 中成功编译的代码的编译错误
- 捕获而不尝试成功编译
- 为什么以下代码在VS2010中成功编译