c++ - '...' 标记之前的预期声明说明符或 '*'

标签 c++ c mingw-w64

我正在尝试在 MinGW 中构建(这在 VS2005 中构建良好)但在以下位置遇到此错误:

#ifndef int64
#define int64 __int64 /**< Win32 version of 64-bit integers */
#endif

// also in class.h
#ifndef FADDR
#define FADDR
typedef int64 (*FUNCTIONADDR)(void*,...); /** the entry point of a module function */
#endif

我得到的错误是:

 error: expected declaration specifiers or '...' before '*' token
 typedef int64 (*FUNCTIONADDR)(void*,...); /** the entry point of a module function */
                ^

关于如何处理这个问题有什么建议吗? 谢谢。

最佳答案

__int64part来自 MSVC,在 GCC 中不存在。您可以改用 stdint.h 中的 int64_t。简单检查:

#ifdef _MSC_VER
typedef __int64 int64;
#else
#include <stdint.h>
typedef int64_t int64;
#endif

关于c++ - '...' 标记之前的预期声明说明符或 '*',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25253266/

相关文章:

c - 为什么函数堆栈帧中的参数、变量和帧指针之间存在间隙?

c - 如何在 C 中检测/分析内存(堆、指针)读写?

c++ - 解决对成员的请求...这是非类类型

c++ - 如何正确使用 std::shared_from_this 或绕过它?

linux - 没有信号量的交替

c++ - 用eof和sentinel infile

c++ - Qt 5.12.0 MinGW 7.3 w64从windows 64交叉编译到windows x86

mingw-w64 - mingw64 未使用 msys2 正确安装

c++ - 对分配器感知类调用复制构造函数中的 vector 元素的引用

c++ - 从main.cpp中分离一些函数时出现 "undefined symbols for architecture"错误,怎么办?