I managed to build the Qt libraries with OpenSSL support and was able to compile and run a test application. I used the wcecompat and OpenSSL patches that Maurice sent to the list about two weeks ago. I copied the libs from the wcecompat folder to the OpenSSL lib folder and I also copied the wcecompat headers to the OpenSSL include folder. I then removed the files that I had copied from the wcecompat include folder. that were causing the compiler to complain about redefinitions. That includes the sys/stat.h and all other files outside the sys folder except for errno.h and winsock_extras.h.
So, its true that wcecompat does contain some legacy code. The other thing is that when I used the -openssl-linked switch in the configure command, I wasn't able to compile my test application. I got a bunch of "unresolved external symbol" errors. However, when I used -openssl (instead of -openssl-linked) in the configure command, I did get my test application to compile and run. I had to bundle the OpenSSL dlls along with the application though. Thanks to Maurice for his support and Nikolay for his helpful suggestions. I'll contribute whatever I can in the future when I get some free time to help maintain wcecompat. --Andreas On Wed, Feb 3, 2010 at 11:52 PM, Andreas Unger <[email protected]>wrote: > Maurice, > > Have you tried compiling Qt with OpenSSL support at all? OpenSSL > compilation went fine (though it did fail one test as you said it would), > but now I can't compile Qt while including the OpenSSL headers and libraries > as mentioned below. > > Thanks, > Andreas > > > On Sat, Jan 23, 2010 at 8:04 AM, Andreas Unger <[email protected]>wrote: > >> I got to the point where I was able to compile both wcecompat and >> subsequently, OpenSSL. The last OpenSSL test did fail as you mentioned but >> the libs were built alright. Now, when I configure Qt adding the flags -I >> C:\Qt\openssl-0.9.8l\inc32 -L C:\Qt\openssl-0.9.8l\out32_MIPSII -openssl , >> the configure part goes well, but when I run nmake, I get an error saying >> the 'errno.h' cannot be found. >> >> Line 87 of err.h in the OpenSSL include folder contains this >> statement #include <errno.h>. The issue is that errno.h is contained in the >> wcecompat include folder. Since I can't include wcecompat when I'm building >> Qt libraries because of the conflicts between the files in wcecompat and the >> Qt source, errno.h cannot be found. >> >> Any idea how I should go about fixing this? >> >> Thanks, >> Andreas >> >> On Fri, Jan 22, 2010 at 11:58 AM, Maurice Kalinowski < >> [email protected]> wrote: >> >>> Hi, >>> >>> you're lucky that Friday has not ended yet :) >>> >>> Attached you can find some patches to both wcecompat and openssl to get >>> at least the libraries compiling. The build process stops when compiling one >>> of its tests, but I hope that the libraries are ok. >>> >>> Steps which need to be done after patching and compilation of wcecompat: >>> 1. set WCECOMPAT=<path to wcecompat> >>> 2. set PLATFORM=STANDARDSDK // you can basically use anything, it is >>> getting ignored >>> 3. ensure that ActiveState Perl is being used, not any perl used by mingw >>> or such >>> 4. perl Configure VC-CE >>> 5. ms\do_ms.bat >>> 6. nmake -f ms\cedll.mak >>> >>> This compiles the libraries dynamically. Might work for static version as >>> well, haven't tried. >>> >>> In addition I would like to emphasize, that this is a spare time hack, >>> not supported at all. Also it has only been tested for the MIPS II platform >>> from Standard SDK for Windows CE 5.0. In case it works for you, I hope that >>> someone is willing to provide a proper patch after cleanup :) >>> >>> Generally I think that we should remove the winsock stuff from wcecompat >>> as basically all Windows CE 5 SDKs seem to have it. So my guess is, that >>> this is some legacy code for Windows CE 4.2, which I guess nobody is using >>> anymore these days. >>> >>> Hope it works for you and have fun with the patch. >>> >>> Best Regards, >>> Maurice >>> >>> Andreas Unger wrote: >>> >>>> >>>> >>>> On Fri, Jan 22, 2010 at 9:51 AM, Maurice Kalinowski < >>>> [email protected] <mailto:[email protected]>> >>>> wrote: >>>> >>>> Could you please point me to the OpenSSL version you are using, so >>>> that >>>> I can have a look at it? >>>> Download link would be perfect. >>>> >>>> Best Regards, >>>> Maurice >>>> >>>> >>>> Here it is: http://www.openssl.org/source/openssl-0.9.8l.tar.gz >>>> >>>> It's basically the latest release from this page: >>>> http://www.openssl.org/source/ >>>> >>>> > >>>> > C:\Program Files (x86)\Windows CE >>>> > Tools\wce500\STANDARDSDK_500\include\MIPSII\winsock2.h(233) : error >>>> > C2011: 'servent' : 'struct' type redefinition >>>> > >>>> > C:\Qt\mauricek-wcecompat/include\winsock_extras.h(30) : see >>>> > declaration of 'servent' >>>> > >>>> > C:\Program Files (x86)\Windows CE >>>> > Tools\wce500\STANDARDSDK_500\include\MIPSII\winsock2.h(2186) : >>>> error >>>> > C2375: 'getservbyname' : redefinition; different linkage >>>> > >>>> > C:\Qt\mauricek-wcecompat/include\winsock_extras.h(37) : see >>>> > declaration of 'getservbyname' NMAKE : fatal error U1077: >>>> '"C:\Program >>>> > Files (x86)\Microsoft Visual Studio >>>> 9.0\VC\ce\bin\x86_mips\cl.EXE"' : >>>> > return code '0x2' >>>> > Stop. >>>> > >>>> > On Fri, Jan 22, 2010 at 9:27 AM, Pablo Rogina <[email protected] >>>> <mailto:[email protected]> >>>> > <mailto:[email protected] <mailto:[email protected]>>> wrote: >>>> > >>>> > > Maurice, I can't thank you enough! It works :-) >>>> > >>>> > Kudos for Maurice, and the one who approved the Creative >>>> Fridays! >>>> > >>>> > Andreas, I understand that you are now able to build Qt with >>>> OpenSSL >>>> > support for WinCE, aren't you? >>>> > >>>> > If so, could it be possibel that you document all the steps >>>> done >>>> > so far? >>>> > >>>> > Thanks. >>>> > >>>> > Pablo Rogina >>>> > _______________________________________________ >>>> > Qt-wince-interest mailing list >>>> > [email protected] >>>> <mailto:[email protected]> >>>> > <mailto:[email protected] >>>> <mailto:[email protected]>> >>>> > http://lists.trolltech.com/mailman/listinfo/qt-wince-interest >>>> > >>>> > >>>> > >>>> >>>> ------------------------------------------------------------------------ >>>> > >>>> > _______________________________________________ >>>> > Qt-wince-interest mailing list >>>> > [email protected] >>>> <mailto:[email protected]> >>>> > http://lists.trolltech.com/mailman/listinfo/qt-wince-interest >>>> > >>>> >>>> >>>> -- >>>> Maurice Kalinowski >>>> Nokia, Qt Development Frameworks >>>> Rudower Chaussee 13, 12489 Berlin, Germany >>>> Email : [email protected] >>>> <mailto:[email protected]> >>>> >>>> Phone : (+49) 30 6392 3255 >>>> Fax : (+49) 30 6392 3256 >>>> http://qt.nokia.com/ >>>> >>>> Nokia gate5 GmbH >>>> Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany >>>> Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B >>>> Umsatzsteueridentifikationsnummer: DE 812 845 193 >>>> Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori >>>> >>>> _______________________________________________ >>>> Qt-wince-interest mailing list >>>> [email protected] >>>> <mailto:[email protected]> >>>> http://lists.trolltech.com/mailman/listinfo/qt-wince-interest >>>> >>>> >>>> ------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> Qt-wince-interest mailing list >>>> [email protected] >>>> http://lists.trolltech.com/mailman/listinfo/qt-wince-interest >>>> >>>> >>> >>> >>> -- >>> Maurice Kalinowski >>> Nokia, Qt Development Frameworks >>> Rudower Chaussee 13, 12489 Berlin, Germany >>> Email : [email protected] >>> Phone : (+49) 30 6392 3255 >>> Fax : (+49) 30 6392 3256 >>> http://qt.nokia.com/ >>> >>> Nokia gate5 GmbH >>> Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany >>> Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B >>> Umsatzsteueridentifikationsnummer: DE 812 845 193 >>> Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori >>> >>> >>> diff --git a/include/errno.h b/include/errno.h >>> index 5ec05ff..41158df 100644 >>> --- a/include/errno.h >>> +++ b/include/errno.h >>> @@ -124,18 +124,18 @@ extern int errno; >>> #define EDEADLK 36 >>> #define EDEADLOCK EDEADLK >>> #endif >>> -#ifndef ENAMETOOLONG >>> -#define ENAMETOOLONG 38 >>> -#endif >>> +//#ifndef ENAMETOOLONG >>> +//#define ENAMETOOLONG 38 >>> +//#endif >>> #ifndef ENOLCK >>> #define ENOLCK 39 >>> #endif >>> #ifndef ENOSYS >>> #define ENOSYS 40 >>> #endif >>> -#ifndef ENOTEMPTY >>> -#define ENOTEMPTY 41 >>> -#endif >>> +//#ifndef ENOTEMPTY >>> +//#define ENOTEMPTY 41 >>> +//#endif >>> >>> #ifndef EINVAL >>> #define EINVAL 22 >>> diff --git a/include/io.h b/include/io.h >>> index 27faeb4..7691856 100644 >>> --- a/include/io.h >>> +++ b/include/io.h >>> @@ -43,7 +43,9 @@ FILE* _wcefdopen( int handle, const char *mode ); >>> #define _open _wceopen >>> #define close _wceclose >>> #define read _wceread >>> +#define _read _wceread >>> #define write _wcewrite >>> +#define _write _wcewrite >>> #define lseek _wcelseek >>> #define _lseek _wcelseek >>> #define unlink _wceunlink >>> diff --git a/include/winsock_extras.h b/include/winsock_extras.h >>> index 62f0f5b..9bb4a00 100644 >>> --- a/include/winsock_extras.h >>> +++ b/include/winsock_extras.h >>> @@ -22,25 +22,16 @@ >>> #ifndef __wcecompat__WINSOCK_EXTRAS_H__ >>> #define __wcecompat__WINSOCK_EXTRAS_H__ >>> >>> - >>> #ifdef __cplusplus >>> extern "C" { >>> #endif >>> >>> -struct servent { >>> - char* s_name; >>> - char** s_aliases; >>> - short int s_port; >>> - char* s_proto; >>> -} servent; >>> - >>> -struct servent* getservbyname(const char* name, const char* proto); >>> - >>> +#include <winsock2.h> >>> >>> +//struct servent* getservbyname(const char* name, const char* proto); >>> >>> #ifdef __cplusplus >>> } >>> #endif >>> >>> - >>> #endif // __wcecompat__WINSOCK_EXTRAS_H__ >>> diff --git a/src/winsock_extras.cpp b/src/winsock_extras.cpp >>> index c7ff990..16affdb 100644 >>> --- a/src/winsock_extras.cpp >>> +++ b/src/winsock_extras.cpp >>> @@ -173,6 +173,7 @@ static struct sserv _serv_table[142]={ >>> 10012, "udp", "qmaster", >>> }; >>> >>> +#if 0 >>> struct servent* getservbyname(const char* name, >>> const char* proto) >>> { >>> @@ -204,3 +205,4 @@ struct servent* getservbyname(const char* name, >>> >>> return &se; >>> } >>> +#endif >>> >>> diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c >>> index d108353..35da0c3 100644 >>> --- a/crypto/rand/randfile.c >>> +++ b/crypto/rand/randfile.c >>> @@ -72,6 +72,9 @@ >>> #ifdef OPENSSL_SYS_VMS >>> #include <unixio.h> >>> #endif >>> +#ifdef OPENSSL_SYS_WINCE >>> +#include <io.h> >>> +#endif >>> #ifndef NO_SYS_TYPES_H >>> # include <sys/types.h> >>> #endif >>> @@ -81,7 +84,7 @@ >>> # include <sys/stat.h> >>> #endif >>> >>> -#ifdef _WIN32 >>> +#if defined(_WIN32) && !defined(OPENSSL_SYS_WINCE) >>> #define stat _stat >>> #define chmod _chmod >>> #define open _open >>> diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c >>> index 341e0ba..ef0201f 100644 >>> --- a/crypto/x509/by_dir.c >>> +++ b/crypto/x509/by_dir.c >>> @@ -74,7 +74,7 @@ >>> #include <openssl/lhash.h> >>> #include <openssl/x509.h> >>> >>> -#ifdef _WIN32 >>> +#if defined(_WIN32) && !defined(OPENSSL_SYS_WINCE) >>> #define stat _stat >>> #endif >>> >>> diff --git a/e_os.h b/e_os.h >>> index 9c5c6fd..f4cab37 100644 >>> --- a/e_os.h >>> +++ b/e_os.h >>> @@ -322,6 +322,8 @@ static unsigned int _strlen31(const char *str) >>> # include <fcntl.h> >>> >>> # ifdef OPENSSL_SYS_WINCE >>> +# include <winsock2.h> >>> +# include <errno.h> >>> # include <winsock_extras.h> >>> # endif >>> >>> @@ -480,7 +482,11 @@ static unsigned int _strlen31(const char *str) >>> # define SHUTDOWN(fd) close(fd) >>> # define SHUTDOWN2(fd) close(fd) >>> # elif !defined(__DJGPP__) >>> +# if !defined(_WIN32_WCE) >>> # include <winsock.h> >>> +# else >>> +# include <winsock2.h> >>> +# endif >>> extern HINSTANCE _hInstance; >>> # ifdef _WIN64 >>> /* >>> diff --git a/ssl/ssltest.c b/ssl/ssltest.c >>> index b09c542..4dd96a3 100644 >>> --- a/ssl/ssltest.c >>> +++ b/ssl/ssltest.c >>> @@ -161,8 +161,12 @@ >>> */ >>> >>> #ifdef OPENSSL_SYS_WINDOWS >>> +# ifndef OPENSSL_SYS_WINCE >>> #include <winsock.h> >>> #else >>> +# include <winsock2.h> >>> +# endif >>> +#else >>> #include OPENSSL_UNISTD >>> #endif >>> >>> diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl >>> index 85121c8..06e6cf6 100644 >>> --- a/util/pl/VC-32.pl >>> +++ b/util/pl/VC-32.pl >>> @@ -65,6 +65,7 @@ elsif ($FLAVOR =~ /CE/) >>> die '%OSVERSION% value is insane' if ($wcevers !~ >>> /^WCE([1-9])([0-9]{2})$/); >>> $wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN >>> $wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN >>> + $wcelflag .= " /NODEFAULTLIB:OLDNAMES.LIB coredll.lib ws2.lib >>> corelibc.lib"; >>> >>> $wceplatf = $ENV{'PLATFORM'}; >>> $wceplatf =~ tr/a-z0-9 /A-Z0-9_/d; >>> >>> >>> _______________________________________________ >>> Qt-wince-interest mailing list >>> [email protected] >>> http://lists.trolltech.com/mailman/listinfo/qt-wince-interest >>> >>> >> >
_______________________________________________ Qt-wince-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-wince-interest
