C++ 使用g++;,使用llvm编译ok
我真的不知道该怎么办。我有一些在iOS和Linux服务器上共享的代码。iOS LLVM编译器编译得很好,但是当我尝试在Linux上使用g++进行编译时,会出现许多错误。第一个是:C++ 使用g++;,使用llvm编译ok,c++,templates,compiler-errors,g++,C++,Templates,Compiler Errors,G++,我真的不知道该怎么办。我有一些在iOS和Linux服务器上共享的代码。iOS LLVM编译器编译得很好,但是当我尝试在Linux上使用g++进行编译时,会出现许多错误。第一个是: RemoveLight.h: In member function ‘void RemoveLight<WindowDerived, ChunkDerived, dim>::lightRemoveEditStart()’: RemoveLight.h:49:17: error: ‘FloodFillLigh
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
RemoveLight.h:在成员函数“void RemoveLight::lightremoveditstart()”中:
RemoveLight.h:49:17:错误:“FloodFillLight”未在此作用域中声明
RemoveLight.h:49:45:错误:应在“,”标记之前使用主表达式
RemoveLight.h:49:59:错误:应在“,”标记之前使用主表达式
这是第49行:
FloodFillLight<WindowDerived, ChunkDerived, dim>(x, i, z, target, chunkWindow);
泛光灯(x、i、z、目标、窗口);
我的RemoveLight.h中包含了FloodFillLight.h,所以这不是问题所在,我的模板都在一个.h文件中声明。我没有在cpp文件中定义模板的任何部分。有人有想法吗?尝试预处理该文件,并确保在使用泛光灯之前声明了泛光灯 可能是一个流浪的ifdef弄乱了你的包裹