Russian Qt Forum

Qt => Установка, сборка, отладка, тестирование => Тема начата: RedDog от Март 28, 2011, 08:27



Название: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 28, 2011, 08:27
Делаю сборку по мануалу: http://prog.org.ru/wiki/index.php?title=%D0%A1%D0%B1%D0%BE%D1%80%D0%BA%D0%B0_Qt_%D1%81_%D0%BF%D0%BE%D0%B4%D0%B4%D0%B5%D1%80%D0%B6%D0%BA%D0%BE%D0%B9_Open_SSL_%D0%B2_Windows
конфигурю вот так:
Код:
configure -static -debug-and-release -openssl-linked -nomake demos -nomake examples
собираю:
Код:
mingw32-make sub-src
в результате получаю:
Цитировать
ssl\/qsslsocket_openssl_symbols_p.h:266: error: 'STACK' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:266: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:267: error: 'STACK' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:267: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:267: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:267: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:269: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:269: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:270: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:270: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:271: error: 'SSL_CIPHER' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:271: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:271: error: expected primary-expression before 'char'
ssl\/qsslsocket_openssl_symbols_p.h:271: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:271: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:272: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:272: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:277: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:277: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:279: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:279: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:279: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:279: error: expected primary-expression before 'long'
ssl\/qsslsocket_openssl_symbols_p.h:279: error: expected primary-expression before 'void'
ssl\/qsslsocket_openssl_symbols_p.h:279: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:280: error: variable or field 'q_SSL_CTX_free' declared void
ssl\/qsslsocket_openssl_symbols_p.h:280: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:280: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:284: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:286: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:286: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:286: error: expected primary-expression before 'const'
ssl\/qsslsocket_openssl_symbols_p.h:286: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:287: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:287: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:288: error: variable or field 'q_SSL_CTX_set_verify' declared void
ssl\/qsslsocket_openssl_symbols_p.h:288: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:288: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:288: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:288: error: 'c' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:288: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:288: error: 'X509_STORE_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:288: error: expected primary-expression before ')' token
ssl\/qsslsocket_openssl_symbols_p.h:289: error: variable or field 'q_SSL_CTX_set_verify_depth' declared void
ssl\/qsslsocket_openssl_symbols_p.h:289: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:289: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:289: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:290: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:290: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:290: error: expected primary-expression before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:290: error: 'b' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:290: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:291: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:291: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:291: error: expected primary-expression before 'const'
ssl\/qsslsocket_openssl_symbols_p.h:291: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:291: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:292: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:292: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:292: error: 'EVP_PKEY' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:292: error: 'b' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:292: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:293: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:293: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:293: error: 'RSA' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:293: error: 'b' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:293: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:294: error: 'SSL_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:294: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:294: error: expected primary-expression before 'const'
ssl\/qsslsocket_openssl_symbols_p.h:294: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:294: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:295: error: variable or field 'q_SSL_free' declared void
ssl\/qsslsocket_openssl_symbols_p.h:295: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:295: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:300: error: expected constructor, destructor, or type conversion before '(' token
ssl\/qsslsocket_openssl_symbols_p.h:305: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:307: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:307: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:307: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:307: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:308: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:309: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:309: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:314: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:314: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:318: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:319: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:319: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:319: error: expected primary-expression before 'void'
ssl\/qsslsocket_openssl_symbols_p.h:319: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:319: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:320: error: variable or field 'q_SSL_set_bio' declared void
ssl\/qsslsocket_openssl_symbols_p.h:320: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:320: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:320: error: 'BIO' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:320: error: 'b' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:320: error: 'BIO' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:320: error: 'c' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:321: error: variable or field 'q_SSL_set_accept_state' declared void
ssl\/qsslsocket_openssl_symbols_p.h:321: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:321: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:322: error: variable or field 'q_SSL_set_connect_state' declared void
ssl\/qsslsocket_openssl_symbols_p.h:322: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:322: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:323: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:323: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:334: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:335: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:336: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:337: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:338: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:339: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:340: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:341: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:343: error: 'SSL' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:343: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:343: error: expected primary-expression before 'const'
ssl\/qsslsocket_openssl_symbols_p.h:343: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:343: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:352: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:354: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:357: error: expected constructor, destructor, or type conversion before numeric constant
ssl\/qsslsocket_openssl_symbols_p.h:358: error: expected constructor, destructor, or type conversion before numeric constant
ssl\/qsslsocket_openssl_symbols_p.h:359: error: 'X509_STORE_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:359: error: 'ctx' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:360: error: 'a' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:360: error: expected primary-expression before 'char'
ssl\/qsslsocket_openssl_symbols_p.h:360: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:360: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:361: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:362: error: variable or field 'q_X509_STORE_free' declared void
ssl\/qsslsocket_openssl_symbols_p.h:362: error: 'X509_STORE' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:362: error: 'store' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:363: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:364: error: 'X509_STORE' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:364: error: 'ctx' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:364: error: expected primary-expression before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:364: error: 'x' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:364: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:365: error: variable or field 'q_X509_STORE_CTX_free' declared void
ssl\/qsslsocket_openssl_symbols_p.h:365: error: 'X509_STORE_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:365: error: 'storeCtx' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:366: error: 'X509_STORE_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:366: error: 'ctx' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:366: error: 'X509_STORE' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:366: error: 'store' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:367: error: expected primary-expression before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:367: error: 'x509' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:367: error: expected primary-expression before ')' token
ssl\/qsslsocket_openssl_symbols_p.h:367: error: 'STACK_OF' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:367: error: 'chain' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:367: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:368: error: expected constructor, destructor, or type conversion before '*' token
ssl\/qsslsocket_openssl_symbols_p.h:369: error: 'X509_STORE_CTX' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:369: error: 'ctx' was not declared in this scope
ssl\/qsslsocket_openssl_symbols_p.h:369: error: expected primary-expression before 'int'
ssl\/qsslsocket_openssl_symbols_p.h:369: error: initializer expression list treated as compound expression
ssl\/qsslsocket_openssl_symbols_p.h:418: error: ISO C++ forbids declaration of 'ASN1_TIME' with no type
ssl\/qsslsocket_openssl_symbols_p.h:418: error: expected ',' or '...' before '*' token
In file included from ssl\qsslcertificate.cpp:114:
ssl\/qsslkey_p.h:89: error: ISO C++ forbids declaration of 'RSA' with no type
ssl\/qsslkey_p.h:89: error: expected ';' before '*' token
ssl\/qsslkey_p.h:90: error: ISO C++ forbids declaration of 'DSA' with no type
ssl\/qsslkey_p.h:90: error: expected ';' before '*' token
ssl\/qsslkey_p.h: In constructor 'QSslKeyPrivate::QSslKeyPrivate()':
ssl\/qsslkey_p.h:68: error: class 'QSslKeyPrivate' does not have any field named 'rsa'
ssl\/qsslkey_p.h:69: error: class 'QSslKeyPrivate' does not have any field named 'dsa'
ssl\qsslcertificate.cpp: In member function 'QByteArray QSslCertificate::version() const':
.....
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `D:/Qt/2010.05/qt/src/network'
mingw32-make: *** [sub-network-sub_src_target_ordered] Error 2

где ошибся?


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: Sahab от Март 28, 2011, 09:56
инклуды где?


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 28, 2011, 10:02
в смысле ssl-евские?
все как по мануалу: QTDID\qt\include\openssl


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: Sahab от Март 28, 2011, 10:29
не видит...
тут "QTDID\qt\include\openssl" именно openssl-хидеры?


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 28, 2011, 10:37
не видит...
тут "QTDID\qt\include\openssl" именно openssl-хидеры?
Ну да, все как в мануале, папку openssl хидеров перенес в папку Qt хидеров


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 31, 2011, 08:29
И правда, оказалось, что не видел, переустановил Qt - собралось.
Но! Не работает статически собранные ехе-шники на чистой винде ХР.
Симптомы:
WinXP  &  Qt 4.7.0. OpenSource & Win32 OpenSSL v1.0.0d
Правлю <QTDIR>\mkspecs\win32-g++\qmake.conf
Код:
QMAKE_LFLAGS = -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
конфигурирую Qt:
Код:
configure -static -debud-and-release -openssl-linked -nomake demos -nomake examples
компилю:
Код:
mingw32-make sub-src
В результате всех этих действий, ехе-шник полученный из собранной статической Qt требует mingwm10.dll и
Код:
QSslSocket::supportsSsl() == false;

Где я не прав?
PS: Винды (обе и с Qt и чистая) стоят на виртуалке в VirtualBox из за этого дело не может быть часом?


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: Sahab от Март 31, 2011, 10:29
Цитировать
требует mingwm10.dll
Код:
-no-exceptions
Цитировать
QSslSocket::supportsSsl() == false;
Код:
LIBS += -lssl -lcrypto


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 31, 2011, 10:37
Прошу прощения за тупость, эти параметры куда вписывать? В командную строку configure?


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: Sahab от Март 31, 2011, 10:52
Цитировать
configure -static -debud-and-release -openssl-linked -nomake demos -nomake examples -no-exceptions

Код:
LIBS += -lssl -lcrypto
- в pro-файл Вашего приложения, которому нужно ssl


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 31, 2011, 13:52
Код:
LIBS += -lssl -lcrypto
- в pro-файл Вашего приложения, которому нужно ssl
При сборке приложения говорит:
Цитировать
c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lssl
где их взять?


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: Пантер от Март 31, 2011, 14:10
Нужно еще через -L задать путь к либам.


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 31, 2011, 14:13
Нужно еще через -L задать путь к либам.
я скопировал ibeay32.lib ssleay32.lib в папку Qt qt\lib
какой еще путь им нужен?
(Извините за тупость)


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: Пантер от Март 31, 2011, 14:15
libssl.a


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 31, 2011, 14:25
А у меня нету такого файла... Как его получить? М.б. у меня в конфигурировании что не верно указано?


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: Пантер от Март 31, 2011, 14:33
поищи файл *libssl*


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 31, 2011, 14:42
Нету, искал...


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 31, 2011, 15:51
И еще не понятен момент: почему в системе, где установлена Qt все работает из любой папки, хотя в путях ничего, что бы относилось к Qt и SSL нигде не прописано, а в чистой системе не работает?


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: Sahab от Март 31, 2011, 20:31
у тебя отсутствуют статические либы openssl.
собираешь, закидываешь в mingw\lib и будет тебе счастье


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Март 31, 2011, 22:49
у тебя отсутствуют статические либы openssl.
собираешь, закидываешь в mingw\lib и будет тебе счастье
Что отсутствуют я понял, вот только не понял почему. Из папки <OpenSSL>\lib\mingw скопировал все в <QTDIR>\mingw\lib сконфигурил с вышеозначенными ключами, перекомпилил (ошибок не выдало), но они нигде не появились. Как их сделать или где достать?


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Апрель 01, 2011, 13:08
А есть ли какой нибудь способ конфигурить исключительно то, что касается SSL не перекомпиляя всю библиотеку? А то уж больно долго она собирается...


Название: Re: Qt + OpenSSL статическая сборка
Отправлено: RedDog от Апрель 01, 2011, 14:32
В общем дело все было не в Qt и OpenSSL, а точнее последней для правильной работы требуется "Visual C++ 2008 Redistributable Package".