Announcement

Collapse
No announcement yet.

QT 4 und MySQL

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • QT 4 und MySQL

    Hallo zusammen,


    ich habe ein Problem das ich mit einer SQL Datenbank eine Verbindung aufbauen muss und Daten Abfragen. Nun hab ich gesehen das QTSql den QMYSQL Treiber gar nicht kennt. Ich habe so verhackte Threads im I-Net gefunden die besagen man muss QT explizit sagen es soll mit den mysql Treibern compiliert werden.


    Meine Umgebung:
    CodeBlocks 8.02 als Entwicklungsumgebung
    Qt 4.x.x (glaube 4.2.02, bin aber nich genau sicher)
    Windows Umgebung

    Kann mir da jemand eine Lösung zeigen? Die auch vollständig alle Schritte benennt?



    Vielen Dank für eure Hilfe!

    Gruss
    Roman


    p.s.: ich weiss nicht ob dies der richtige Bereich ist, ansonsten bitte verschieben.

  • #2
    Auch hallo,

    QT liegt mittlerweile in der Version 4.4 (und höher) als OpenSource und Professionalvariante vor. Aber vielleicht hilft diese Seite trotzdem weiter.
    MfG
    Cheat-Sheets for Developers / Programming Quotes

    Comment


    • #3
      Vielen Dank das ist eine Super Anleitung,


      trotzdem habe ich das Problem das ich reimp nicht finde, somit kann ich Schritt 2. des HowTo nicht machen.


      Wenn ich dies einfach überspringe dann haperts beim ausführen des Befehl make, da motzt er:

      Code:
      C:\Qt\4.4.3\src\plugins\sqldrivers\mysql>make
      mingw32-make -f Makefile.Debug all
      mingw32-make[1]: Entering directory `C:/Qt/4.4.3/src/plugins/sqldrivers/mysql'
      g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
      DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
      DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
      nclude\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include\QtSql" -I"..
      \..\..\..\include" -I"c:\Progra~1\MySQL\MySQLS~1.0\include" -I"c:\Qt\4.4.3\inclu
      de\ActiveQt" -I"tmp\moc\debug_shared" -I"." -I"c:\Qt\4.4.0\mkspecs\win32-g++" -o
       tmp\obj\debug_shared\main.o main.cpp
      In file included from C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/
      windows.h:50,
                       from ../../../../include/QtCore/../../src/corelib/global/qt_win
      dows.h:52,
                       from ../../../../include/QtCore/qt_windows.h:1,
                       from ../../../sql/drivers/mysql/qsql_mysql.h:45,
                       from main.cpp:40:
      C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1663: error:
       declaration of C function `LONG InterlockedCompareExchange(volatile LONG*, LONG
      , LONG)' conflicts with
      ../../../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:387: error:
      previous declaration `long int InterlockedCompareExchange(long int*, long int, l
      ong int)' here
      C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1667: error:
       declaration of C function `LONG InterlockedDecrement(volatile LONG*)' conflicts
       with
      ../../../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:389: error:
      previous declaration `long int InterlockedDecrement(long int*)' here
      C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1668: error:
       declaration of C function `LONG InterlockedExchange(volatile LONG*, LONG)' conf
      licts with
      ../../../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:390: error:
      previous declaration `long int InterlockedExchange(long int*, long int)' here
      C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1672: error:
       declaration of C function `LONG InterlockedExchangeAdd(volatile LONG*, LONG)' c
      onflicts with
      ../../../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:391: error:
      previous declaration `long int InterlockedExchangeAdd(long int*, long int)' here
      
      C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:1676: error:
       declaration of C function `LONG InterlockedIncrement(volatile LONG*)' conflicts
       with
      ../../../../include/QtCore/../../src/corelib/arch/qatomic_windows.h:388: error:
      previous declaration `long int InterlockedIncrement(long int*)' here
      In file included from main.cpp:40:
      ../../../sql/drivers/mysql/qsql_mysql.h:48:19: mysql.h: No such file or director
      y
      In file included from main.cpp:40:
      ../../../sql/drivers/mysql/qsql_mysql.h:103: error: expected `)' before '*' toke
      n
      mingw32-make[1]: *** [tmp/obj/debug_shared/main.o] Error 1
      mingw32-make[1]: Leaving directory `C:/Qt/4.4.3/src/plugins/sqldrivers/mysql'
      mingw32-make: *** [debug-all] Error 2

      Irgend eine Ahnung?

      Danke!

      Comment

      Working...
      X