我在任何地方都进行了搜索,在Windows(8.1,x64)下静态编译Qt仍然存在多个问题。我已经尝试了几篇描述如何做到这一点的文章,最后一篇文章(How to compile Qt 5 under Windows or Linux, 32 or 64 bit, static or dynamic on VS2010, VS2012, VS2013 or VS2015 Express or g++)显然与我的案例最为接近,但它仍然不完美。应用此处指出的更改(Build static Qt project with Visual Studio 2015)后,我有错误:
Error LNK2019 unresolved external symbol gethostname referenced in function "public: static class QString __cdecl QSysInfo::machineHostName(void)" (?machineHostName@QSysInfo@@SA?AVQString@@XZ)
Error LNK2019 unresolved external symbol WSAStartup referenced in function "public: __cdecl QWindowsSockInit::QWindowsSockInit(void)" (??0QWindowsSockInit@@QEAA@XZ)
Error LNK2019 unresolved external symbol WSACleanup referenced in function "public: __cdecl QWindowsSockInit::~QWindowsSockInit(void)" (??1QWindowsSockInit@@QEAA@XZ)
Error LNK2019 unresolved external symbol WSAAsyncSelect referenced in function "public: void __cdecl QEventDispatcherWin32Private::doWsaAsyncSelect(int,long)" (?doWsaAsyncSelect@QEventDispatcherWin32Private@@QEAAXHJ@Z)
在Windows SDK中包含ws2_32.dll后不见了。好的,我现在能够在我的Visual Studio中运行我的项目,但由于以下错误,我无法运行exe文件(这是静态链接的原始点):
This application failed to start because it could not find or load the Qt platform plugin "windows" in "".
有人可以帮帮我吗?我花了几天时间试图解决这个问题。