windows下编译Hugin时的template错误

Hugin依赖于VIGRA,而VIGRA包含大量的模板,编译Hugin是出现以下的大量错误:app

"unexpected token(s) preceding ':'; skipping apparent function body"spa

"'vigra::NumericTraits<unsigned char>': cannot specialize template in current scope"token

这种模板类的错误信息很不明确,致使定位错误来源十分困难。ip

没办法,逐个cpp文件单独编译,逐一排查,发现是huginbase工程中的Exiv2Helper.cpp编译出错。ci

而后逐句注释、编译,最后发现是包含头文件的顺序致使的。即把:it

#include "Exiv2Helper.h"
#include "hugin_math/hugin_math.h"io

改成:
#include "hugin_math/hugin_math.h"
#include "Exiv2Helper.h"编译

就行了。function

相关文章
相关标签/搜索