【发布时间】:2023-03-17 08:50:01
【问题描述】:
我正在尝试使用 MinGW 在 32 位 Windows 7 中构建 PCL 库。在构建outofcore 模块时,我收到了几条关于_fseeki64 的错误消息:
error: there are no arguments to '_fseeki64' that depend on a template parameter, so a declaration of '_fseeki64' must be available
在octree_disk_container.h文件中,有一个
#ifndef WIN32
#define _fseeki64 fseeko
#endif
我已经测试过(生成#error)并且WIN32 是在处理文件时定义的。 _fseeki64 似乎可用于编译器,因为这个小测试程序编译:
#include "stdio.h"
int main(int argc, char** argv) {
FILE* f = fopen("C:/a.txt","r");
if(!f) printf("NOPE");
int seekret = _fseeki64(f,4,SEEK_SET);
(void)seekret;
return 0;
}
如果我将_fseeki64 定义为fseeko64,则错误消失并且模块编译,但我不确定fseeko 的行为是否与fseeki 的行为相同。
那么,我该怎么做才能在这种情况下使用_fseeki64?也许声明一个新的基类,将#define 放在那里,然后像Base<T>::_fseeki64 一样调用它? (从here得到想法)
你有什么想法?
【问题讨论】:
标签: c++ templates mingw fseek name-lookup