2012-04-22 80 views
-1

我特林加載包含使用該obj loader球頂點OBJ文件,我得到這個錯誤,當我編譯:鏈接錯誤,當加載obj文件

1>ShaderPerspective.obj : error LNK2019: unresolved external symbol "public: int __thiscall objLoader::load(char *)" ([email protected]@@[email protected]) referenced in function "void __cdecl loadObj(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" ([email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z

失敗的代碼是:

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

我知道,這是一個鏈接錯誤,但作爲一個位以C初學者++和Visual Studio的,如果任何人都可以就如何得到正確的方向指向我這個工作,我將不勝感激。

回答

0

你有什麼試過?我懷疑你只需要將其項目納入解決方案。或者可能只需將其.obj文件添加到鏈接器選項。

+0

我試過,包括頭文件,像這樣: 的#include 「../objTester/list.h」 的#include 「../objTester/obj_parser.h」 的#include」 ../objTester/objLoader。 h「 #include」../objTester/string_extra.h「 其中給出了上述錯誤。我剛剛將項目添加到我的解決方案中,看看是否可行,但是如何將其包含在當前項目中? – bananamana 2012-04-22 19:37:56