简体   繁体   English

无法解决的外部符号异常

[英]Abnormal unresolved external symbol error

I have a project that used to compile just fine, using the freetype library. 我有一个使用freetype库可以正常编译的项目。

Since then my OS has been reinstalled and therefore so has Visual Studio 2010. 从那时起,我的操作系统已重新安装,因此Visual Studio 2010也已重新安装。

I have re-included and reinstalled all of the .lib .dll and header files. 我已经重新包括并重新安装了所有.lib .dll和头文件。 For some reason now if I run the program with the release configuration it runs just fine. 现在由于某种原因,如果我使用发行版配置运行该程序,它将运行正常。 But if I switch over to the debug config, it gives me unresolved external symbol errors from the linker, on the freetype library functions. 但是,如果我切换到调试配置,则会在freetype库函数上给我来自链接器的未解决的外部符号错误。

Now I'm sure my C++ directories for both configurations are identical as I re-set them using the all-configurations tab in the solution settings. 现在,当我使用解决方案设置中的“所有配置”选项卡重新设置它们时,我确定这两种配置的C ++目录都相同。 As well as this, so are both configurations "additional directories/additional dependancies settings", set identically in the same way. 除此之外,两个配置“其他目录/其他相关性设置”也以相同的方式进行了相同的设置。

The only difference I could find between the release and debug folders in the project folder, is the presence of a file in the debug folder called "vc100.idb", which is a minimum rebuild dependancy file. 我可以在项目文件夹的release和debug文件夹之间找到的唯一区别是,调试文件夹中存在一个名为“ vc100.idb”的文件,这是一个最小的重建依赖文件。 This looked promising, but removing it yielded no results, so I put it back. 这看起来很有希望,但是删除它没有任何结果,所以我放回去。

Do you have any ideas of what could be causing this difference between the configurations compiling? 您是否有什么想法会导致配置编译之间的差异?

Worst come to worst, I can continue programming on the release config, but I'd rather not continue down this road as I'd really like to know the root of this problem. 最糟糕的是,我可以继续在发行版配置上编程,但是我不想继续走这条路,因为我真的很想知道这个问题的根源。

Thanks in advance, 提前致谢,

Guy 家伙

The errors: 错误:

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)

Edit : OK well this is strange. 编辑 :好的,这很奇怪。 I've removed ALL of the freetype directory information rom the include and library directory setting in the release config, as well as the additional dependancies. 我已经从发行配置中的包含和库目录设置中删除了所有自由类型目录信息,以及其他相关性。 And the released config version still works! 并且发布的配置版本仍然有效!

This is leading me to believe there is something missing (vs config-wise) from moving my files over. 这使我相信将文件移至其他位置(相对于配置)。

I had the same problem. 我有同样的问题。

I solved it by compiling the freetype ( freetype-2.5.2\\builds\\windows\\vc2010\\freetype.sln ) solution for the x64 platform (or win32 if you use it). 我通过为x64平台(或win32如果使用它)编译freetype (freetype-2.5.2 \\ builds \\ windows \\ vc2010 \\ freetype.sln)解决方案来解决该问题。

You will get the .libs for this platform. 您将获得此平台的.libs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM