加载.obj文件时链接器错误

时间:2012-04-22 18:53:38

标签: c++ visual-studio-2010 visual-studio

我想使用这个obj loader加载包含球体顶点的obj文件,并且在编译时出现此错误:

1>ShaderPerspective.obj : error LNK2019: unresolved external symbol "public: int __thiscall objLoader::load(char *)" (?load@objLoader@@QAEHPAD@Z) referenced in function "void __cdecl loadObj(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?loadObj@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z

失败的代码是:

void loadObj(const std::string &strObjFile)
{
    objLoader *objData = new objLoader();
    objData->load("data\\sphere.obj");  
}

我知道这是一个链接器错误但是有点像c ++和Visual Studio的初学者,如果有人能指出我正确的方向如何让它工作我将不胜感激。

1 个答案:

答案 0 :(得分:0)

你有什么尝试?我怀疑你只需将其项目作为解决方案的一部分。或者可能只是将其.obj文件添加到链接器选项。