Расскажите мне, чтобы можно было использовать QSslSocket это надо в обязательном порядке качать OpenSSL? Или в Qt есть внутренняя реализация этой библиотеки?
У меня например сегодняшний снапшот OpenSSL отказывался конфигурироваться в MSYS. Опять начались косяки со слэшами. Пришлось прибегнуть к такому:
export PERL=/c/Perl/bin/perl.exe;
./config
make
windres -i QtNetworkd_resource.rc -o tmp\obj\debug_shared\QtNetworkd_resource_re
s.o --include-dir=.
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:\SABROG\Qt46\qt\lib\libQtNetworkd4.a
-o ..\..\lib\QtNetworkd4.dll object_script.QtNetworkd.Debug -L"c:\SABROG\Qt46\
qt\lib" -L"c:\SABROG\openssl-SNAP-20090703" -L"c:\SABROG\Qt46\qt\lib" -lws2_32 t
mp\obj\debug_shared\QtNetworkd_resource_res.o -lssleay32 -llibeay32 -lQtCored4
c:/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot fin
d -lssleay32
# ifdef Q_OS_WIN
QLibrary *ssleay32 = new QLibrary(QLatin1String("ssleay32"));
if (!ssleay32->load()) {
// Cannot find ssleay32.dll
delete ssleay32;
return pair;
}
QLibrary *libeay32 = new QLibrary(QLatin1String("libeay32"));
if (!libeay32->load()) {
delete ssleay32;
delete libeay32;
return pair;
}
pair.first = ssleay32;
pair.second = libeay32;
return pair;
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -mthreads -Wl -shared -Wl,--out-implib,c:\SABROG\Qt46\qt\lib\libQtNetworkd4.a
-o ..\..\lib\QtNetworkd4.dll object_script.QtNetworkd.Debug -L"c:\SABROG\Qt46\
qt\lib" -L"c:\SABROG\openssl-SNAP-20090703" -L"c:\SABROG\Qt46\qt\lib" -lws2_32 t
mp\obj\debug_shared\QtNetworkd_resource_res.o -lssleay32 -llibeay32 -lQtCored4
Creating library file: c:\SABROG\Qt46\qt\lib\libQtNetworkd4.a
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(bss_sock.o):bss_sock.c:(.text+0x13
f): undefined reference to `shutdown@8'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(bss_sock.o):bss_sock.c:(.text+0x18
1): undefined reference to `WSASetLastError@4'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(bss_sock.o):bss_sock.c:(.text+0x1a
5): undefined reference to `send@16'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(bss_sock.o):bss_sock.c:(.text+0x24
9): undefined reference to `WSASetLastError@4'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(bss_sock.o):bss_sock.c:(.text+0x26
9): undefined reference to `recv@16'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(bss_sock.o):bss_sock.c:(.text+0x3a
f): undefined reference to `shutdown@8'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xda
0): undefined reference to `CreateDCA@16'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xda
f): undefined reference to `CreateCompatibleDC@4'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xdc
8): undefined reference to `GetDeviceCaps@8'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xde
3): undefined reference to `GetDeviceCaps@8'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xe0
4): undefined reference to `CreateCompatibleBitmap@12'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xe1
b): undefined reference to `SelectObject@8'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xe3
e): undefined reference to `GetObjectA@12'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xee
4): undefined reference to `BitBlt@36'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xef
b): undefined reference to `GetBitmapBits@12'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xf7
0): undefined reference to `SelectObject@8'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xf7
b): undefined reference to `DeleteObject@4'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xf8
8): undefined reference to `DeleteDC@4'
c:\SABROG\openssl-SNAP-20090703/liblibeay32.a(rand_win.o):rand_win.c:(.text+0xf9
5): undefined reference to `DeleteDC@4'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [..\..\lib\QtNetworkd4.dll] Error 1
mingw32-make[2]: Leaving directory `C:/SABROG/Qt46/qt/src/network'
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `C:/SABROG/Qt46/qt/src/network'
mingw32-make: *** [sub-network-make_default-ordered] Error 2
у меня были похожие ошибки и действия при первой попытке собрать драйвер QIbase.
Оказалось, что reimplement, или как он там, ненадобыло запускать, хотя все так и рекомендовали.
Ты случаем его не запускал?
Нет, не запускал. Сейчас попробовал заменить в файле .qmake.cache, что появляется после configure это:
OPENSSL_LIBS = -lssleay32 -llibeay32
OPENSSL_LIBS = -lssl -lcrypto -lgdi32 -lwsock32
Ура собралось всё как linked, ни одной лишней .dll. Проверил на двух примерах, вроде всё пашет:
У мну не собирается - на этапе компилячии вываливается с ошибками на тему QSslCertificate
g++ -c -include tmp\obj\release_static\qt_pch.h -O2 -Wall -frtti -fexceptions -mthreads -DQT_THREAD_SUPPORT -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_BUILD_NETWORK_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -D_USE_MATH_DEFINES -DQT_NO_DEBUG -DQT_CORE_LIB -I"..\..\include\QtCore" -I"..\..\include" -I"h:\OpenSSL\include" -I"..\..\include\QtNe
twork" -I"tmp\rcc\release_static" -I"tmp" -I"..\3rdparty\zlib" -I"kernel" -I"..\..\include\ActiveQt" -I"tmp\moc\release_static" -I"." -I"." -I"h:\MySQL\include" -I"h:\OpenSSL\include\openssl" -I"..\..\mkspecs\win32-g++" -o tmp\obj\release_static\qsslcertificate.o ssl\qsslcertificate.cpp
In file included from ssl\/qsslsocket_p.h:61,
from ssl\/qsslsocket_openssl_p.h:57,
from ssl\/qsslsocket_openssl_symbols_p.h:57,
from ssl\qsslcertificate.cpp:109:
ssl\/qsslconfiguration_p.h:88: error: `QSslCertificate' does not name a type
ssl\/qsslconfiguration_p.h:89: error: `QSslCertificate' was not declared in this scope
Покажи строку конфигурирования. Делал make confclean прежде чем переконфигурировать Qt заново?
H:\Qt\2009.02\qt>configure -release -static -openssl OPENSSL_LIBS="-lssl -lcrypto -lgdi32 -lwsock32 -llibeay32 -lssleay32" -I h:\OpenSSL\include -L h:\OpenSSL\lib -l libeay32 -l ssleay32
H:\Qt\2009.02\qt>configure -release -static -openssl-linked OPENSSL_LIBS="-lssl -lcrypto -lgdi32 -lwsock32 -llibeay32 -lssleay32" -I h:\OpenSSL\include -L h:\OpenSSL\lib -l libeay32 -l ssleay32
H:\Qt\2009.02\qt>configure -release -static -openssl-linked OPENSSL_LIBS="-llibeay32 -lssleay32" -I h:\OpenSSL\include -L h:\OpenSSL\lib -l libeay32 -l ssleay32
H:\Qt\2009.02\qt>configure -release -static -openssl-linked OPENSSL_LIBS="-llibeay32 -lssleay32" -I h:\OpenSSL\include -L h:\OpenSSL\lib
H:\Qt\2009.02\qt>configure -release -static -openssl-linked OPENSSL_LIBS="-llibeay32 -lssleay32" -I h:\OpenSSL\include\openssl -L h:\OpenSSL\lib
Я так http://vingrad.ru/blogs/sabrog/2009/07/06/452-kompilyatsiya-qt-s-podderzhkoy-qsslsocket/.
Спасибо. Помогла только установка свежего Qt (2009.03).
Возможно мой был уже побит жизнью.. -)
Форум Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)