c语言外部程序未解析,C语言 QT 5.6静态未解析的外部符号

我正在使用QWidget开发一个小应用程序并静态链接Qt 5.6.我现在正在使用VS12.

#include

#include

int main(int argc, char *argv[])

{

QApplication a(argc, argv);

QMainWindow w;

w.show();

return a.exec();

}

它编译得很好,但我收到链接器错误.

1>libGLESv2d.lib(global_state.obj) : error LNK2019: unresolved external symbol "unsigned long __cdecl CreateTLSIndex(void)" (?CreateTLSIndex@@YAKXZ) referenced in function "struct A0x6526a104::Current * __cdecl `anonymous namespace'::GetCurrentData(void)" (?GetCurrentData@?A0x6526a104@@[email protected]@XZ)

1>libGLESv2d.lib(global_state.obj) : error LNK2019: unresolved external symbol "bool __cdecl DestroyTLSIndex(unsigned long)" (?DestroyTLSIndex@@[email protected]) referenced in function [email protected]

1>libGLESv2d.lib(global_state.obj) : error LNK2019: unresolved external symbol "bool __cdecl SetTLSValue(unsigned long,void *)" (?SetTLSValue@@[email protected]) referenced in function "struct A0x6526a104::Current * __cdecl `anonymous namespace'::AllocateCurrent(void)" (?AllocateCurrent@?A0x6526a104@@[email protected]@XZ)

1>libGLESv2d.lib(global_state.obj) : error LNK2019: unresolved external symbol "void * __cdecl GetTLSValue(unsigned long)" (?GetTLSValue@@[email protected]) referenced in function "void __cdecl `anonymous namespace'::DeallocateCurrent(void)" (?DeallocateCurrent@?A0x6526a104@@YAXXZ)

1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "bool __cdecl sh::InterpolationTypesMatch(enum sh::InterpolationType,enum sh::InterpolationType)" ([email protected]@@[email protected]@[email protected]) referenced in function "private: static bool __cdecl gl::Program::linkValidateVaryings(class gl::InfoLog &,class std::basic_string,class std::allocator > const &,struct sh::Varying const &,struct sh::Varying const &)" ([email protected]@gl@@[email protected]@[email protected][email protected]@std@@[email protected]@2@@std@@[email protected]@@[email protected])

1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "public: struct sh::ShaderVariable & __thiscall sh::ShaderVariable::operator=(struct sh::ShaderVariable const &)" ([email protected]@@[email protected]@@Z) referenced in function "private: bool __thiscall gl::Program::linkAttributes(class gl::InfoLog &,class gl::AttributeBindings const &,class gl::Shader const *)" ([email protected]@gl@@[email protected]@[email protected]@[email protected]@@Z)

1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "public: __thiscall sh::Attribute::Attribute(void)" ([email protected]@@[email protected]) referenced in function "public: __thiscall gl::Program::Program(class rx::ProgramImpl *,class gl::ResourceManager *,unsigned int)" ([email protected]@@[email protected]@rx@@[email protected]@[email protected])

1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "public: __thiscall sh::Attribute::~Attribute(void)" ([email protected]@@[email protected]) referenced in function "public: __thiscall gl::Program::Program(class rx::ProgramImpl *,class gl::ResourceManager *,unsigned int)" ([email protected]@@[email protected]@rx@@[email protected]@[email protected])

1>libGLESv2d.lib(ProgramImpl.obj) : error LNK2001: unresolved external symbol "public: __thiscall sh::Attribute::~Attribute(void)" ([email protected]@@[email protected])

1>libGLESv2d.lib(Program.obj) : error LNK2019: unresolved external symbol "public: struct sh::Attribute & __thiscall sh::Attribute::operator=(struct sh::Attribute const &)" ([email protected]@@[email protected]@@Z) referenced in function "void __cdecl std::_Fill(struct sh::Attribute *,struct sh::Attribute *,struct sh::Attribute const &)" ([email protected]@sh@@U12@@std@@[email protected]@@0ABU12@@Z)

我已经包含以下库:

winmm.lib

imm32.lib

Ws2_32.lib

opengl32.lib

Qt5Guid.lib

Qt5Widgetsd.lib

qtpcred.lib

qtharfbuzzngd.lib

Qt5PlatformSupportd.lib

qwindowsd.lib

libEGLd.lib

libGLESv2d.lib

qtfreetyped.lib

Qt5Cored.lib

有趣的是,如果使用QtCreator它编译,链接和运行就好了.

我看到的是QtCreator添加了以下编译标志:

-DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_OPENGL_ES_2_ANGLE_STATIC -DGL_APICALL= -DEGLAPI=

我在我的项目中尝试了它们,但它没有改变任何东西.

我错过了什么?我需要什么才能使程序链接?

我找到了.这是使其工作所需的库列表:

winmm.lib

imm32.lib

Ws2_32.lib

Qt5Guid.lib

Qt5Widgetsd.lib

qtpcred.lib

qtharfbuzzngd.lib

Qt5PlatformSupportd.lib

qwindowsd.lib

libEGLd.lib

libGLESv2d.lib

qtfreetyped.lib

Qt5Cored.lib

+ preprocessord.lib

+ translatord.lib

+ d3d9.lib

+ dxguid.lib

不需要opengl32.lib.我仍然不知道为什么QtCreator知道需要哪些库以及为什么VS2013不需要.谢谢你的帮助.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值