异常未解决的外部符号错误

时间:2013-02-06 16:55:42

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

我有一个项目,用于使用freetype库进行编译。

从那时起,我的操作系统已经重新安装,因此Visual Studio 2010也是如此。

我重新包含并重新安装了所有.lib .dll和头文件。出于某种原因,如果我使用发布配置运行程序,它运行得很好。但是,如果我切换到调试配置,它会在自由类型库函数上从链接器给出未解决的外部符号错误。

现在我确定两个配置的C ++目录是相同的,因为我使用解决方案设置中的all-configurations选项卡重新设置它们。除此之外,两个配置“附加目录/附加依赖项设置”也是如此,以相同方式设置相同。

我可以在项目文件夹中的发布和调试文件夹之间找到的唯一区别是,调试文件夹中存在一个名为“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 *)" (?make_dlist@freetype@@YAXPAUFT_FaceRec_@@DIPAI@Z)
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 *)" (?make_dlist@freetype@@YAXPAUFT_FaceRec_@@DIPAI@Z)
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 *)" (?make_dlist@freetype@@YAXPAUFT_FaceRec_@@DIPAI@Z)
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 *)" (?make_dlist@freetype@@YAXPAUFT_FaceRec_@@DIPAI@Z)
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)" (?init@font_data@freetype@@QAEXPBDI@Z)
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)" (?init@font_data@freetype@@QAEXPBDI@Z)
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)" (?init@font_data@freetype@@QAEXPBDI@Z)
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)" (?init@font_data@freetype@@QAEXPBDI@Z)
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)" (?init@font_data@freetype@@QAEXPBDI@Z)

编辑:好的,这很奇怪。我删除了发布配置中include和library目录设置的freetype目录信息的 ALL ,以及其他依赖项。发布的配置版仍然有效!

这让我相信移动我的文件会丢失(vs config-wise)。

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。

我通过为freetype平台编译x64(freetype-2.5.2 \ builds \ windows \ vc2010 \ freetype.sln)解决方案来解决它(如果你使用win32它)。

您将获得此平台的.libs