Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Compilar mysql en qt



  • Hola, alguien ha podido compilar con exito las librerias de mysql para las versiones de Qt Open Source?
    He intentando haciendolo con el conector para c 6.1 y el de c++ 8 sin exito

    Basicamente hice esto:

    Entrada

    CD %QTDIR%\5.14.0\Src\qtbase\src\plugins\sqldrivers\mysql
    Y dentro de la carpeta

    set MYSQL_PREFIX=MYSQL_PREFIX="C:/Program Files/MySQL/MySQL Connector C 6.1"
    luego de esto
    mingw32-make

    la salida es:

    cd odbc\ && ( if not exist Makefile C:\Qt\Qt5.14.0\5.14.0\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\Qt5.14.0\5.14.0\Src\qtbase\src\plugins\sqldrivers\odbc\odbc.pro "INCLUDEPATH+=C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" "LIBS+=C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib\libmysql.lib" ) && mingw32-make -f Makefile
    mingw32-make[1]: Entering directory 'C:/Qt/Qt5.14.0/5.14.0/Src/qtbase/src/plugins/sqldrivers/mysql/odbc'
    g++ -c -fno-keep-inline-dllexport -O2 -g -std=c++1z -fno-exceptions -Wall -Wextra -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -IC:\Qt\Qt5.14.0\5.14.0\Src\qtbase\src\plugins\sqldrivers\odbc -I. -IC:\Program -IFiles -I(x86)\MySQL\MySQL -IConnector -IC -I6.1\include -IC:\Qt\Qt5.14.0\5.14.0\mingw73_32\include\QtSql\5.14.0 -IC:\Qt\Qt5.14.0\5.14.0\mingw73_32\include\QtSql\5.14.0\QtSql -IC:\Qt\Qt5.14.0\5.14.0\mingw73_32\include\QtCore\5.14.0 -IC:\Qt\Qt5.14.0\5.14.0\mingw73_32\include\QtCore\5.14.0\QtCore -IC:\Qt\Qt5.14.0\5.14.0\mingw73_32\include -IC:\Qt\Qt5.14.0\5.14.0\mingw73_32\include\QtSql -IC:\Qt\Qt5.14.0\5.14.0\mingw73_32\include\QtCore -I.moc -IC:\openssl\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresql\pgsql\include -IC:\Qt\Qt5.14.0\5.14.0\mingw73_32\mkspecs\win32-g++ -o .obj\main.o C:\Qt\Qt5.14.0\5.14.0\Src\qtbase\src\plugins\sqldrivers\odbc\main.cpp
    C:\Qt\Qt5.14.0\5.14.0\Src\qtbase\src\plugins\sqldrivers\odbc\main.cpp:73:10: fatal error: main.moc: No such file or directory
    #include "main.moc"
    ^~~~~~~~~~
    compilation terminated.
    mingw32-make[1]: *** [Makefile:871: .obj/main.o] Error 1
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.14.0/5.14.0/Src/qtbase/src/plugins/sqldrivers/mysql/odbc'
    mingw32-make: *** [Makefile:51: sub-odbc-make_first] Error 2

    Eh probado tratando de establecer bien la direccion del conector de c 6.1 para mysql pero el resultado ha sido el mismo



  • He logrado resolver el problema
    Hice un video para quien lo quiera ver

    https://www.youtube.com/watch?v=bFkXjfFvmJo&feature=share



  • He logrado resolver el problema
    Hice un video para quien lo quiera ver

    https://www.youtube.com/watch?v=bFkXjfFvmJo&feature=share


  • Moderators

    Estupendo

    Gracias por compartir la soluciĆ³n.

    Un saludo


Log in to reply