小编Gáb*_*yal的帖子

Qt Qt5Network静态构建链接错误

我正在尝试使用OpenSSL支持进行Qt(版本5.4.1)的静态构建.我配置如下:

configure -opensource -release -c++11 -static -platform win32-msvc2013 
-openssl-linked  -I C:\OpenSSL-Win32\include 
-L C:\OpenSSL-Win32\lib\VC\static
-nomake examples -nomake tests
Run Code Online (Sandbox Code Playgroud)

include和lib目录有效.我收到大量的链接错误Qt5Network.lib.

Qt5Network.lib(qhttpnetworkconnectionchannel.obj) : error LNK2019: unresolved ex
ternal symbol "public: static class QSharedPointer<class QSslContext> __cdecl QS
slSocketPrivate::sslContext(class QSslSocket *)" (?sslContext@QSslSocketPrivate@
@SA?AV?$QSharedPointer@VQSslContext@@@@PAVQSslSocket@@@Z) referenced in function
 "protected: void __thiscall QHttpNetworkConnectionChannel::_q_connected(void)"
(?_q_connected@QHttpNetworkConnectionChannel@@IAEXXZ)
Qt5Network.lib(qhttpprotocolhandler.obj) : error LNK2019: unresolved external sy
mbol "public: __int64 __thiscall QSslSocket::encryptedBytesToWrite(void)const "
(?encryptedBytesToWrite@QSslSocket@@QBE_JXZ) referenced in function "private: vi
rtual bool __thiscall QHttpProtocolHandler::sendRequest(void)" (?sendRequest@QHt
tpProtocolHandler@@EAE_NXZ)
C:\Qt\5.4\qtbase\bin\xmlpatterns.exe : fatal error LNK1120: 31 unresolved …
Run Code Online (Sandbox Code Playgroud)

c++ deployment qt compilation static-linking

11
推荐指数
1
解决办法
2112
查看次数

使用“new”调用复制构造函数

我对 C++ 很陌生。

我已经读过复制构造函数在将对象作为参数传递给函数或从函数返回对象时以及通过赋值初始化变量时被调用。在这种情况下也可以调用它吗,假设 D 有复制构造函数?

D* pd1 = new D;
D* pd2 = new D(*pd1);
Run Code Online (Sandbox Code Playgroud)

c++ copy-constructor

3
推荐指数
1
解决办法
6189
查看次数