Qt 3.1.0

Martin Fuchs kde-cygwin@mail.kde.org
Sat, 2 Nov 2002 13:36:31 +0100


--------------Boundary-00=_VC8YMZKYDMO02S7QJI0M
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi!

I've tried to compile the Qt 3.1.0 beta under cycwin.
Starting with the original version from Trolltech I had to tweak it a bit=
=2E
Attached is a diff file with the adjustments.
I could sucessfully compile it in the "-static" mode.
However I have problems to link it as shared object (aka DLL).
For example, when linking the image format plugins, the cygwin ld complai=
ns=20
about missing functions like QString::upper() and some more...
Although this functions ARE compiled and present in the qstring.o object =
file.=20
The problem is: They are not propperly exported from the DLL. I also foun=
d=20
the "__declspec dllexport"-declarations in class QString. So - what's the=
=20
problem here - why doesn't export ld this functions?!

Since you have manged to successfully build Qt 2 (and may be 3.0.4 ?), I'=
m=20
asking for some help here.

P.S.:
I've tried to additionally specify "Q_EXPORT" in qstring.cpp. This seems =
to=20
solve the problem for this few functions. But there are much more...

--=20
Martin Fuchs
martin-fuchs@gmx.net
--------------Boundary-00=_VC8YMZKYDMO02S7QJI0M
Content-Type: text/x-diff;
  charset="us-ascii";
  name="qt310-cygwin.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="qt310-cygwin.diff"

diff -ru qt-x11-free-3.1.0-b2-org/mkspecs/cygwin-g++/qmake.conf qt-x11-fr=
ee-3.1.0-b2/mkspecs/cygwin-g++/qmake.conf
--- qt-x11-free-3.1.0-b2-org/mkspecs/cygwin-g++/qmake.conf=09Mon Sep 30 1=
6:22:13 2002
+++ qt-x11-free-3.1.0-b2/mkspecs/cygwin-g++/qmake.conf=09Fri Nov  1 01:33=
:28 2002
@@ -56,7 +56,7 @@
 QMAKE_RPATH=09=09=3D -Wl,-rpath,
=20
 QMAKE_LIBS=09=09=3D
-QMAKE_LIBS_DYNLOAD=09=3D -ldl
+##MF QMAKE_LIBS_DYNLOAD=09=3D -ldl
 QMAKE_LIBS_X11=09=09=3D -lXext -lX11
 QMAKE_LIBS_X11SM=09=3D -lSM -lICE
 QMAKE_LIBS_QT=09=09=3D -lqt
diff -ru qt-x11-free-3.1.0-b2-org/mkspecs/cygwin-g++/qplatformdefs.h qt-x=
11-free-3.1.0-b2/mkspecs/cygwin-g++/qplatformdefs.h
--- qt-x11-free-3.1.0-b2-org/mkspecs/cygwin-g++/qplatformdefs.h=09Fri Sep=
  6 03:46:17 2002
+++ qt-x11-free-3.1.0-b2/mkspecs/cygwin-g++/qplatformdefs.h=09Thu Oct 31 =
22:45:49 2002
@@ -42,9 +42,11 @@
=20
 #include <sys/types.h>
 #include <sys/ioctl.h>
+#ifndef __CYGWIN__=09//MF
 #include <sys/ipc.h>
-#include <sys/time.h>
 #include <sys/shm.h>
+#endif
+#include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
diff -ru qt-x11-free-3.1.0-b2-org/plugins/src/imageformats/jpeg/jpeg.pro =
qt-x11-free-3.1.0-b2/plugins/src/imageformats/jpeg/jpeg.pro
--- qt-x11-free-3.1.0-b2-org/plugins/src/imageformats/jpeg/jpeg.pro=09Mon=
 Apr 29 15:59:12 2002
+++ qt-x11-free-3.1.0-b2/plugins/src/imageformats/jpeg/jpeg.pro=09Fri Nov=
  1 11:59:32 2002
@@ -1,5 +1,5 @@
 TEMPLATE =3D lib
-CONFIG +=3D qt plugin
+CONFIG +=3D qt plugin dll
 TARGET +=3D qjpeg
 VERSION =3D 1.0.0
 REQUIRES =3D !no-jpeg !jpeg
diff -ru qt-x11-free-3.1.0-b2-org/src/kernel/qapplication.cpp qt-x11-free=
-3.1.0-b2/src/kernel/qapplication.cpp
--- qt-x11-free-3.1.0-b2-org/src/kernel/qapplication.cpp=09Mon Sep 30 16:=
21:49 2002
+++ qt-x11-free-3.1.0-b2/src/kernel/qapplication.cpp=09Thu Oct 31 23:51:5=
2 2002
@@ -2530,6 +2530,7 @@
 */
=20
 #if defined(Q_OS_CYGWIN)
+#include "qapplication_p.h"//MF
 Qt::WindowsVersion QApplication::winVersion()
 {
     return qt_winver;
diff -ru qt-x11-free-3.1.0-b2-org/src/kernel/qregion_x11.cpp qt-x11-free-=
3.1.0-b2/src/kernel/qregion_x11.cpp
--- qt-x11-free-3.1.0-b2-org/src/kernel/qregion_x11.cpp=09Mon Sep 30 16:2=
1:46 2002
+++ qt-x11-free-3.1.0-b2/src/kernel/qregion_x11.cpp=09Fri Nov  1 11:34:20=
 2002
@@ -44,6 +44,7 @@
=20
 #include <stdlib.h>
=20
+/*MF sonst: multiple definition of `QRect::setCoords...` bei DLL-Export =
=FCber Q_EXPORT=0D
 // inline QRect::setCoords
 inline void QRect::setCoords( int xp1, int yp1, int xp2, int yp2 )
 {
@@ -52,6 +53,7 @@
     x2 =3D (QCOORD)xp2;
     y2 =3D (QCOORD)yp2;
 }
+*/=0D
=20
 /*
  *   clip region
diff -ru qt-x11-free-3.1.0-b2-org/src/network/qdns.cpp qt-x11-free-3.1.0-=
b2/src/network/qdns.cpp
--- qt-x11-free-3.1.0-b2-org/src/network/qdns.cpp=09Mon Sep 30 16:21:40 2=
002
+++ qt-x11-free-3.1.0-b2/src/network/qdns.cpp=09Thu Oct 31 23:49:19 2002
@@ -2119,6 +2119,10 @@
 }
 #endif
=20
+#ifdef Q_OS_CYGWIN //MF
+#include <windows.h> //MF
+#endif
+
 // the following typedefs are needed for GetNetworkParams() API call
 #ifndef IP_TYPES_INCLUDED
 #define MAX_HOSTNAME_LEN    128
diff -ru qt-x11-free-3.1.0-b2-org/src/qt.pro qt-x11-free-3.1.0-b2/src/qt.=
pro
--- qt-x11-free-3.1.0-b2-org/src/qt.pro=09Mon Sep  9 11:19:40 2002
+++ qt-x11-free-3.1.0-b2/src/qt.pro=09Fri Nov  1 01:21:54 2002
@@ -11,6 +11,10 @@
=20
 win32:!shared:CONFIG +=3D staticlib
=20
+
+CONFIG          +=3D dll=09#MF
+
+
 win32-borland {
 =09mng:QMAKE_CFLAGS_WARN_ON=09+=3D -w-par
 =09mng:QMAKE_CXXFLAGS_WARN_ON=09+=3D -w-par
@@ -91,6 +95,7 @@
 =09XML_H=09=09=3D $$XML_CPP
 =09STYLES_H=09=3D $$STYLES_CPP
 =09!embedded:!mac:CONFIG=09   +=3D x11 x11inc
+=09dll:DEFINES+=3DQT_MAKEDLL=09#MF@@
 }
=20
 aix-g++ {
diff -ru qt-x11-free-3.1.0-b2-org/src/tools/qglobal.cpp qt-x11-free-3.1.0=
-b2/src/tools/qglobal.cpp
--- qt-x11-free-3.1.0-b2-org/src/tools/qglobal.cpp=09Mon Sep 30 16:21:36 =
2002
+++ qt-x11-free-3.1.0-b2/src/tools/qglobal.cpp=09Thu Oct 31 22:42:58 2002
@@ -152,7 +152,9 @@
 #if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN)
 bool qt_winunicode;
=20
-#include "qt_windows.h"
+//MF@@#include "qt_windows.h"
+#include "qnamespace.h"//MF
+#include <windows.h>//MF
=20
 int qWinVersion()
 {
diff -ru qt-x11-free-3.1.0-b2-org/src/tools/qglobal.h qt-x11-free-3.1.0-b=
2/src/tools/qglobal.h
--- qt-x11-free-3.1.0-b2-org/src/tools/qglobal.h=09Mon Sep 30 16:21:34 20=
02
+++ qt-x11-free-3.1.0-b2/src/tools/qglobal.h=09Fri Nov  1 14:32:05 2002
@@ -38,7 +38,10 @@
 #ifndef QGLOBAL_H
 #define QGLOBAL_H
=20
-#define QT_VERSION_STR   "3.1.0-b2"
+#define _WIN32_X11_ //MF
+
+#define QT_VERSION_STR   "3.1.0" //MF
+//MF #define QT_VERSION_STR   "3.1.0-b2"
 /*
    QT_VERSION is (major << 16) + (minor << 8) + patch.
  */
@@ -754,7 +757,7 @@
 // Create Qt DLL if QT_DLL is defined (Windows only)
 //
=20
-#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
+#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_CYGWIN)//=
MF
 #  if defined(QT_NODLL)
 #    undef QT_MAKEDLL
 #    undef QT_DLL
@@ -792,7 +795,7 @@
 // Some platform specific stuff
 //
=20
-#if defined(Q_WS_WIN)
+#if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)//MF
 extern Q_EXPORT bool qt_winunicode;
 #endif
=20
@@ -803,7 +806,7 @@
=20
 Q_EXPORT const char *qVersion();
 Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian );
-#if defined(Q_WS_WIN)
+#if defined(Q_WS_WIN) || defined(Q_OS_CYGWIN)//MF
 Q_EXPORT int qWinVersion();
 #if defined(UNICODE)
 #define QT_WA( uni, ansi ) if ( qt_winunicode ) { uni } else { ansi }
diff -ru qt-x11-free-3.1.0-b2-org/src/tools/qstring.cpp qt-x11-free-3.1.0=
-b2/src/tools/qstring.cpp
--- qt-x11-free-3.1.0-b2-org/src/tools/qstring.cpp=09Mon Sep 30 16:21:35 =
2002
+++ qt-x11-free-3.1.0-b2/src/tools/qstring.cpp=09Fri Nov  1 17:04:37 2002
@@ -12485,7 +12485,7 @@
     Returns the uppercase equivalent if the character is lowercase;
     otherwise returns the character itself.
 */
-QChar QChar::upper() const
+Q_EXPORT/*@@*/ QChar QChar::upper() const
 {
      return ::upper( *this );
 }
@@ -14690,7 +14690,7 @@
     \endcode
 */
=20
-int QString::contains( QChar c, bool cs ) const
+Q_EXPORT/*@@*/ int QString::contains( QChar c, bool cs ) const
 {
     int count =3D 0;
     const QChar *uc =3D unicode();
@@ -14720,7 +14720,7 @@
     If \a cs is TRUE, the search is case sensitive; otherwise the
     search is case insensitive.
 */
-int QString::contains( const char* str, bool cs ) const
+Q_EXPORT/*@@*/ int QString::contains( const char* str, bool cs ) const
 {
     return contains( QString(str), cs );
 }
@@ -14773,7 +14773,7 @@
     \sa findRev()
 */
=20
-int QString::contains( const QString &str, bool cs ) const
+Q_EXPORT/*@@*/ int QString::contains( const QString &str, bool cs ) cons=
t
 {
     if ( isNull() )
 =09return 0;
@@ -15005,7 +15005,7 @@
     \sa lower()
 */
=20
-QString QString::upper() const
+Q_EXPORT/*@@*/ QString QString::upper() const
 {
     QString s(*this);
     int l=3Dlength();
@@ -15085,7 +15085,7 @@
     \sa stripWhiteSpace()
 */
=20
-QString QString::simplifyWhiteSpace() const
+Q_EXPORT/*@@*/ QString QString::simplifyWhiteSpace() const
 {
     if ( isEmpty() )
 =09return *this;
@@ -15810,7 +15810,7 @@
     \sa find() findRev()
 */
=20
-int QString::contains( const QRegExp &rx ) const
+Q_EXPORT/*@@*/ int QString::contains( const QRegExp &rx ) const
 {
     int count =3D 0;
     int index =3D -1;
@@ -16565,7 +16565,7 @@
=20
     \sa utf8(), local8Bit()
 */
-const char* QString::latin1() const
+Q_EXPORT/*@@*/ const char* QString::latin1() const
 {
     if ( !d->ascii ) {
 =09Q2HELPER(stat_get_ascii++)

--------------Boundary-00=_VC8YMZKYDMO02S7QJI0M--