Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, May 2008
[Win32] Build fails to find QSslSocket, succeeds with QTcpSocket


Message 1 in thread

1. I'm building code in Win32 with VSC++ 2005,
and under Linux with g++.

2. I have a class that derives from QSslSocket.
This compiles and links without error under Linux,
but fails with:

> Generating moc_HTTPListener.cxx
> Compiling...
> moc_HTTPListener.cxx
> e:\code\mdp_qt\builds\win32\src\lib\../../../../src/lib/HTTPListener.h(44) : error C2504: 'QSslSocket' : base class undefined
> .\moc_HTTPListener.cxx(82) : error C2653: 'QSslSocket' : is not a class or namespace name
> .\moc_HTTPListener.cxx(96) : error C2653: 'QSslSocket' : is not a class or namespace name
> .\moc_HTTPListener.cxx(101) : error C2653: 'QSslSocket' : is not a class or namespace name
> HTTPListener.cpp

in VSC++.

3. If I derive from QTcpSocket rather than QSslSocket, it compiles
and links fine.

4. The include dirs seem to be fine for VSC++ and point to the
include/QtNetwork directory, amongst others. Both QTcpSocket and
QSslSocket files are present in include/QtNetwork.

Does anyone know what I'm doing wrong ?

-- 
 [ signature omitted ] 

Message 2 in thread

Stephen Collyer schrieb:
> 1. I'm building code in Win32 with VSC++ 2005,
> and under Linux with g++.
> 
> 2. I have a class that derives from QSslSocket.
> This compiles and links without error under Linux,
> but fails with:
> 
>> Generating moc_HTTPListener.cxx
>> Compiling...
>> moc_HTTPListener.cxx
>> e:\code\mdp_qt\builds\win32\src\lib\../../../../src/lib/HTTPListener.h(44) : error C2504: 'QSslSocket' : base class undefined
>> .\moc_HTTPListener.cxx(82) : error C2653: 'QSslSocket' : is not a class or namespace name
>> .\moc_HTTPListener.cxx(96) : error C2653: 'QSslSocket' : is not a class or namespace name
>> .\moc_HTTPListener.cxx(101) : error C2653: 'QSslSocket' : is not a class or namespace name
>> HTTPListener.cpp
> 
> in VSC++.
> 
> 3. If I derive from QTcpSocket rather than QSslSocket, it compiles
> and links fine.
> 
> 4. The include dirs seem to be fine for VSC++ and point to the
> include/QtNetwork directory, amongst others. Both QTcpSocket and
> QSslSocket files are present in include/QtNetwork.
> 
> Does anyone know what I'm doing wrong ?
> 
Your Qt is not build with openssl support.


Christian

--
 [ signature omitted ] 

Message 3 in thread

Christian Ehrlicher wrote:

>>
> Your Qt is not build with openssl support.

OK. In that case I'm confused. The default setting for
Win32 configure is to build with Openssl support
and I didn't change that. *However*, I've just realized
that I don't have Openssl binaries installed on the machine
in question. (I thought I had, but I don't). So what I'm
wondering is how the build could have succeeded, given this
combination of configure settings and lack of libraries.

Should'nt it have failed at some point ?

-- 
 [ signature omitted ] 

Message 4 in thread

Stephen Collyer wrote:
>OK. In that case I'm confused. The default setting for
>Win32 configure is to build with Openssl support
>and I didn't change that. *However*, I've just realized
>that I don't have Openssl binaries installed on the machine
>in question. (I thought I had, but I don't). So what I'm
>wondering is how the build could have succeeded, given this
>combination of configure settings and lack of libraries.

The default setting for the Windows build is to detect OpenSSL and, if 
it's present, enable QSslSocket. If it's not present, the classes are 
disabled and the build also succeeds.

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.


Message 5 in thread

On 22.05.08 19:24:54, Stephen Collyer wrote:
> Christian Ehrlicher wrote:
> 
> >>
> > Your Qt is not build with openssl support.
> 
> OK. In that case I'm confused. The default setting for
> Win32 configure is to build with Openssl support
> and I didn't change that. *However*, I've just realized
> that I don't have Openssl binaries installed on the machine
> in question. (I thought I had, but I don't). So what I'm
> wondering is how the build could have succeeded, given this
> combination of configure settings and lack of libraries.
> 
> Should'nt it have failed at some point ?

No, because the default is to build with openssl support if openssl
support is found. If its not found the openssl support in Qt is
disabled. You should pay more attention to the output of configure, it
tells youe exactly which parts are disabled and which are not.

Andreas

-- 
 [ signature omitted ] 

Message 6 in thread

Andreas Pakulat wrote:

>> Should'nt it have failed at some point ?
> 
> No, because the default is to build with openssl support if openssl
> support is found. If its not found the openssl support in Qt is
> disabled. 

OK. So the default setting is overridden if openssl is not
available. I think that's arguably the wrong behaviour.

>You should pay more attention to the output of configure, it
>tells youe exactly which parts are disabled and which are not.

I probably should have, but I clearly didn't. I did look
at the default settings, however, which is what confused me.
I didn't expect them to change.

-- 
 [ signature omitted ] 

Message 7 in thread

> Von: Stephen Collyer
> Andreas Pakulat wrote:
> 
> >> Should'nt it have failed at some point ?
> > 
> > No, because the default is to build with openssl support if openssl
> > support is found. If its not found the openssl support in Qt is
> > disabled. 
> 
> OK. So the default setting is overridden if openssl is not
> available. I think that's arguably the wrong behaviour.
> 
There's a fine difference between '*' and '+':

 *  -no-optimized-qmake ... Do not build qmake optimized.
    -optimized-qmake ...... Build qmake optimized.

    -no-openssl ........ Do not compile support for OpenSSL.
 +  -openssl ........... Enable run-time OpenSSL support.
    -openssl-linked .... Enabled linked OpenSSL support.

* - default setting unless you specify other
+ - preferred setting if all requirements found



Christian
-- 
 [ signature omitted ] 

Message 8 in thread

Christian Ehrlicher wrote:
>> Von: Stephen Collyer
>> Andreas Pakulat wrote:
>>
>>>> Should'nt it have failed at some point ?
>>> No, because the default is to build with openssl support if openssl
>>> support is found. If its not found the openssl support in Qt is
>>> disabled. 
>> OK. So the default setting is overridden if openssl is not
>> available. I think that's arguably the wrong behaviour.
>>
> There's a fine difference between '*' and '+':
> 
>  *  -no-optimized-qmake ... Do not build qmake optimized.
>     -optimized-qmake ...... Build qmake optimized.
> 
>     -no-openssl ........ Do not compile support for OpenSSL.
>  +  -openssl ........... Enable run-time OpenSSL support.
>     -openssl-linked .... Enabled linked OpenSSL support.
> 
> * - default setting unless you specify other
> + - preferred setting if all requirements found

You're right. I looked at that last night and was sure it
was a *. Fair enough. I need a new monitor.

-- 
 [ signature omitted ] 

Message 9 in thread

On Thursday 22 May 2008 19:08:08 Stephen Collyer wrote:
> Does anyone know what I'm doing wrong ?

You built Qt without SSL support. Install OpenSSL and rebuild Qt.

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.