2013-02-06 25 views
1

我有一個使用freetype庫來編譯的很好的項目。異常無法解析的外部符號錯誤

從那時起,我的操作系統已經重新安裝並因此使具有Visual Studio 2010中

我已經重新納入並重新安裝所有的.lib .dll和頭文件。由於某種原因,現在如果我使用發佈配置運行程序,它運行得很好。但是,如果我切換到調試配置,它會給我提供連接器上freetype庫函數無法解析的外部符號錯誤。

現在我確定我的C++目錄對於兩種配置都是相同的,因爲我使用解決方案設置中的全配置選項卡重新設置它們。除此之外,兩個配置「附加目錄/附加依賴設置」也一樣,以相同的方式設置。

我可以在項目文件夾中的發佈和調試文件夾之間找到的唯一區別是調試文件夾中存在名爲「vc100.idb」的文件,這是一個最小重建依賴文件。這看起來很有希望,但刪除它沒有結果,所以我把它放回去。

你有什麼想法可以導致配置編譯之間的這種差異?

最糟糕的是,我可以繼續編程發佈配置,但我寧願不繼續這條道路,因爲我真的想知道這個問題的根源。

由於提前,

蓋伊

的錯誤:

1>freetype.obj : error LNK2019: unresolved external symbol _FT_Glyph_To_Bitmap referenced in function "void __cdecl freetype::make_dlist(struct FT_FaceRec_ *,char,unsigned int,unsigned int *)" ([email protected]@@[email protected]@[email protected]) 
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Get_Glyph referenced in function "void __cdecl freetype::make_dlist(struct FT_FaceRec_ *,char,unsigned int,unsigned int *)" ([email protected]@@[email protected]@[email protected]) 
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Load_Glyph referenced in function "void __cdecl freetype::make_dlist(struct FT_FaceRec_ *,char,unsigned int,unsigned int *)" ([email protected]@@[email protected]@[email protected]) 
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Get_Char_Index referenced in function "void __cdecl freetype::make_dlist(struct FT_FaceRec_ *,char,unsigned int,unsigned int *)" ([email protected]@@[email protected]@[email protected]) 
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Done_FreeType referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" ([email protected][email protected]@@[email protected]) 
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Done_Face referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" ([email protected][email protected]@@[email protected]) 
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Set_Char_Size referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" ([email protected][email protected]@@[email protected]) 
1>freetype.obj : error LNK2019: unresolved external symbol _FT_New_Face referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" ([email protected][email protected]@@[email protected]) 
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Init_FreeType referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" ([email protected][email protected]@@[email protected]) 

編輯:OK嗯,這是奇怪的。我已經刪除了ALL的freetype目錄信息,其中包括髮布配置中的include和library目錄設置以及其他依賴項。而發佈的配置版本仍然有效!

這讓我相信有些東西在移動我的文件時丟失了(vs config-wise)。

+0

調試配置的鏈接器設置與發佈配置的設置是分開的。因此,一個明顯的解釋是,您正確地將freetype .lib文件添加到鏈接程序的發佈配置的其他依賴項設置,但忘記爲調試配置執行此操作。 –

+0

我上面解釋了這一點。我使用'所有配置'同時設置它們。所以他們是彼此的鏡像。 我認爲發佈配置以某種方式「卡住」。正如我的問題的編輯解釋。我目前正在將項目複製到一個新的乾淨的項目中,並帶有一個新的乾淨的解決方案文件。但到目前爲止,我無法正確地獲取與庫鏈接的配置。 –

+0

配置不會「卡住」。通過在鏈接器的命令行設置頁面中添加/ verbose選項來檢查您的假設。您將在Output窗口中看到每個庫的轉儲。 –

回答

1

我有同樣的問題。

我通過編譯freetype(的FreeType-2.5.2 \建立\ WINDOWS \ VC2010 \ freetype.sln)解決方案爲x64平臺(或win32如果您使用它),解決了這個問題。

您將獲得該平臺的.libs

相關問題