我使用链接时优化(-flto
ing++
和ld
命令行),并且我的一些方法声明(在标题中)被标记为extern inline
(并且仅inline
在.cpp
文件中)。编译产量:
./Client/include/GVGLObjects.hpp:96:32: error: storage class specified for 'VertexBuffer'
EFAST VertexBuffer();
^
以及其他方法和功能的一堆类似错误。EFAST
意味着extern inline
。
为什么在启用 LTO 的情况下会发生这种情况?如果不允许这样做,我如何将声明和定义与内联和 LTO 分开?