QT调用OpenGL时的LNK错误

在Windows上编译Linux源代码时遇到了一系列LNK错误,涉及freetype、QGLWidget、GLEW和Q3FileDialog。解决方法包括引入相应头文件、拷贝freetype6.dll、添加QtOpenGLd4.lib、glew32.lib和Qt3Supportd4.lib库,并调整项目属性中的Additional Dependencies设置。通过这些步骤,所有链接错误均得到解决。
摘要由CSDN通过智能技术生成

    从网上下载了"VisLink:Revealing Relationships Amongst Visualizations"论文的源代码。该代码是在Linux上写的,而我的系统是window7,自己建立一个VS2008工程后,发现有一堆bug:

 

FreeType.obj : error LNK2019: unresolved external symbol __imp__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 __imp__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 __imp__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 __imp__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 __imp__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 __imp__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 __imp__FT_Set_Char_Size

LNK2019是Visual Studio编译器的一个错误代码,通常与链接错误相关。当编译器无法找到或解析某个符号(函数、变量等)的定义,就会出现LNK2019错误。在Qt中,常见的LNK2019错误通常是由以下几种情况引起的: 1. 函数或方法未定义:如果在代码中调用了一个函数或方法,但没有提供其定义,编译器就无法找到该函数或方法的实现。这可能是因为函数或方法的实现被遗漏或者没有正确包含相关的头文件。 2. 链接库未添加:如果使用了某个外部库,但没有将其正确添加到项目中,编译器就无法找到该库中定义的符号。在Qt中,可以通过.pro文件或者.pro.user文件来添加链接库。 3. 函数或方法签名不匹配:如果函数或方法的声明与其实现的签名不匹配,编译器就无法正确解析符号。这可能是因为函数或方法的参数类型、返回类型或者const修饰符等不一致。 4. 名字空间冲突:如果在代码中使用了同名的函数、类或变量,并且它们位于不同的命名空间中,编译器可能无法确定要使用哪个符号。这可以使用命名空间限定符来明确指定要使用的符号。 解决LNK2019错误的方法包括: - 确保所有函数和方法的定义都被正确包含或实现。 - 检查是否正确添加了需要链接的库文件。 - 检查函数或方法的声明和实现是否一致。 - 确保没有命名空间冲突。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值