0

我真的不知道该怎么做。我有一些在 iOS 和 Linux 服务器上共享的代码。iOS LLVM 编译器编译得很好,但是当我尝试在 Linux 上使用 g++ 编译时,我得到了很多错误。第一个如下:

RemoveLight.h: In member function ‘void RemoveLight<WindowDerived, ChunkDerived, dim>::lightRemoveEditStart()’:
RemoveLight.h:49:17: error: ‘FloodFillLight’ was not declared in this scope
RemoveLight.h:49:45: error: expected primary-expression before ‘,’ token
RemoveLight.h:49:59: error: expected primary-expression before ‘,’ token

这是第 49 行:

FloodFillLight<WindowDerived, ChunkDerived, dim>(x, i, z, target, chunkWindow);

我确实在 RemoveLight.h 中包含了 FloodFillLight.h,所以这不是问题,我的模板都在 .h 文件中声明。我没有在 cpp 文件中定义模板的任何部分。有人有想法吗?

4

1 回答 1

0

尝试预处理文件并确保在使用之前声明了 FloodFillLight。

可能是一个杂散的#ifdef 混淆了您的包含。

于 2013-03-07T20:07:02.260 回答