繁体   English   中英

使用g ++的模板出现编译错误,使用llvm编译正常

[英]Compiliation error with templates using g++, compiles ok with llvm

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

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文件中定义的模板的任何部分。 有人有主意吗?

尝试对文件进行预处理,并确保在使用前已声明FloodFillLight。

可能是#ifdef流浪者混淆了您的包含文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM