QCTemplate编译但无法链接

时间:2012-12-31 10:11:55

标签: c++ qt linker-errors google-ctemplate

我下载了QCTemplate(http://code.google.com/p/qctemplate/)。 CTemplate(0.95)提供的版本中有一个错误,所以更改 该版本为CTemplate 2.2。

我编译了库但是当我尝试运行helloworld示例时,我得到5 有关ctemplate的错误:: TemplateCache如:

qctemplate.lib(template.obj):-1: error: LNK2019: unresolved external symbol "private: bool __thiscall ctemplate::TemplateCache::ExpandLocked(class ctemplate::TemplateString const &,enum ctemplate::Strip,class ctemplate::ExpandEmitter *,class ctemplate::TemplateDictionaryInterface const *,class ctemplate::PerExpandData *)" (?ExpandLocked@TemplateCache@ctemplate@@AAE_NABVTemplateString@2@W4Strip@2@PAVExpandEmitter@2@PBVTemplateDictionaryInterface@2@PAVPerExpandData@2@@Z) referenced in function "private: bool __thiscall ctemplate::TemplateTemplateNode::ExpandOnce(class ctemplate::ExpandEmitter *,class ctemplate::TemplateDictionaryInterface const &,char const * const,class ctemplate::PerExpandData *,class ctemplate::TemplateCache const *)const " (?ExpandOnce@TemplateTemplateNode@ctemplate@@ABE_NPAVExpandEmitter@2@ABVTemplateDictionaryInterface@2@QBDPAVPerExpandData@2@PBVTemplateCache@2@@Z)

我怎样才能让它发挥作用?

1 个答案:

答案 0 :(得分:0)

解决。我编译了QCtemplate的src但不知何故没有在Qt Creator中导入的template_cache.cc而且它没有被编译。我手动添加它并再次编译它现在有效。