Russian Qt Forum
Ноябрь 24, 2024, 11:39 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
 
  Начало   Форум  WIKI (Вики)FAQ Помощь Поиск Войти Регистрация  

Страниц: [1] 2   Вниз
  Печать  
Автор Тема: Qt + OpenSSL статическая сборка  (Прочитано 14477 раз)
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

где ошибся?
Записан
Sahab
Гость
« Ответ #1 : Март 28, 2011, 09:56 »

инклуды где?
Записан
RedDog
Гость
« Ответ #2 : Март 28, 2011, 10:02 »

в смысле ssl-евские?
все как по мануалу: QTDID\qt\include\openssl
Записан
Sahab
Гость
« Ответ #3 : Март 28, 2011, 10:29 »

не видит...
тут "QTDID\qt\include\openssl" именно openssl-хидеры?
Записан
RedDog
Гость
« Ответ #4 : Март 28, 2011, 10:37 »

не видит...
тут "QTDID\qt\include\openssl" именно openssl-хидеры?
Ну да, все как в мануале, папку openssl хидеров перенес в папку Qt хидеров
Записан
RedDog
Гость
« Ответ #5 : Март 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 из за этого дело не может быть часом?
« Последнее редактирование: Март 31, 2011, 08:31 от RedDog » Записан
Sahab
Гость
« Ответ #6 : Март 31, 2011, 10:29 »

Цитировать
требует mingwm10.dll
Код:
-no-exceptions
Цитировать
QSslSocket::supportsSsl() == false;
Код:
LIBS += -lssl -lcrypto
« Последнее редактирование: Март 31, 2011, 10:33 от Sahab » Записан
RedDog
Гость
« Ответ #7 : Март 31, 2011, 10:37 »

Прошу прощения за тупость, эти параметры куда вписывать? В командную строку configure?
Записан
Sahab
Гость
« Ответ #8 : Март 31, 2011, 10:52 »

Цитировать
configure -static -debud-and-release -openssl-linked -nomake demos -nomake examples -no-exceptions

Код:
LIBS += -lssl -lcrypto
- в pro-файл Вашего приложения, которому нужно ssl
Записан
RedDog
Гость
« Ответ #9 : Март 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
где их взять?
Записан
Пантер
Administrator
Джедай : наставник для всех
*****
Offline Offline

Сообщений: 5876


Жаждущий знаний


Просмотр профиля WWW
« Ответ #10 : Март 31, 2011, 14:10 »

Нужно еще через -L задать путь к либам.
Записан

1. Qt - Qt Development Frameworks; QT - QuickTime
2. Не используйте в исходниках символы кириллицы!!!
3. Пользуйтесь тегом code при оформлении сообщений.
RedDog
Гость
« Ответ #11 : Март 31, 2011, 14:13 »

Нужно еще через -L задать путь к либам.
я скопировал ibeay32.lib ssleay32.lib в папку Qt qt\lib
какой еще путь им нужен?
(Извините за тупость)
Записан
Пантер
Administrator
Джедай : наставник для всех
*****
Offline Offline

Сообщений: 5876


Жаждущий знаний


Просмотр профиля WWW
« Ответ #12 : Март 31, 2011, 14:15 »

libssl.a
Записан

1. Qt - Qt Development Frameworks; QT - QuickTime
2. Не используйте в исходниках символы кириллицы!!!
3. Пользуйтесь тегом code при оформлении сообщений.
RedDog
Гость
« Ответ #13 : Март 31, 2011, 14:25 »

А у меня нету такого файла... Как его получить? М.б. у меня в конфигурировании что не верно указано?
Записан
Пантер
Administrator
Джедай : наставник для всех
*****
Offline Offline

Сообщений: 5876


Жаждущий знаний


Просмотр профиля WWW
« Ответ #14 : Март 31, 2011, 14:33 »

поищи файл *libssl*
Записан

1. Qt - Qt Development Frameworks; QT - QuickTime
2. Не используйте в исходниках символы кириллицы!!!
3. Пользуйтесь тегом code при оформлении сообщений.
Страниц: [1] 2   Вверх
  Печать  
 
Перейти в:  


Страница сгенерирована за 0.06 секунд. Запросов: 23.