c - 错误 : expected initializer before "BOOL CALLBACK _export Function" in Bloodshed Dev-C++ 5. 11

标签 c mingw dev-c++ mingw-w64 tdm-mingw

我尝试在 Bloodshed Dev-C++ 5.11 中编译以下代码:

BOOL CALLBACK _export DialogStartProc(HWND hWnd,UINT Message,WPARAM wParam,LPARAM lParam);
BOOL CALLBACK _export DialogRegProc(HWND hDg1, UINT msg, WPARAM wParam, LPARAM lParam);

出现错误:

... [Error] expected initializer before 'DialogStartProc'
... [Error] expected initializer before 'DialogRegProc'
... C:\Program Files\Dev-Cpp\MinGW64\x86_64-w64-mingw32\include\windows.h   In file included from C:/Program Files/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/windows.h

我在使用 TDM-GCC 4.9.2 32 位和 64 位编译器的 Windows XP 32 位和 Windows 8.1 64 位 + Bloodshed Dev-C++ 5.11 中遇到相同的错误。

在我使用 Bloodshed Dev-C++ 4 编译这段代码之前没有任何错误。 (使用旧的 GNU GCC-2.95.2 编译器)

在使用 GNU GCC 4.9 编译器的 CODE::BLOCK 中,这段代码也可以毫无问题地编译。

可能我必须更改编译器设置?

最佳答案

这些错误仅发生在最新的 MinGW-w64 - 适用于 32 位和 64 位 Windows 编译器(TDM-GCC 4.9.2 32/64 位)。

我认为新的 winuser.h 文件(最后修改于 2014 年 12 月 7 日 20:48)和相应的 lib 文件中存在错误。

如果可以 - 请告诉 MinGW-w64 的开发人员。

关于c - 错误 : expected initializer before "BOOL CALLBACK _export Function" in Bloodshed Dev-C++ 5. 11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46119465/

相关文章:

c - 使用 sun rpc 从服务器发送结构数组到客户端

c - 如何在 FreeBSD 中调试 malloc/memleaks

c - 如何在 C 中使用结构体来使用函数指针?

c - 另一个 MinGW "gcc: error: CreateProcess: No such file or directory"

C - 打印字符串时出现运行时错误(使用指针)

c - 任何给定正整数的必要二进制数字的数量是否真的是 ceil(log_2 n)?

c++ - 如何强制 MinGW 使用 tr1 命名空间?

c++ - Orwell Dev-C++ fatal error : "iostream: no such file or directory"

c++ - 开发 C++ (Mingw) 堆栈限制

c++ - 带有 MSG_PEEK 的 C 'recv' 不返回 -1