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

Installing mysql for qt



  • Hello, I am trying to install the mysql package for qt.

    From the installation guide I got the following instructions:

    cd %QTDIR%\src\plugins\sqldrivers\mysql
    qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
    nmake
    

    With the first two lines I have had problems in the past but it seems like I have solved them.

    The last codeline "nmake" makes problems. I think there is something missing because the Qt 5.14.1 (MSVC 64bit) says "The command "nmake" (I also tried make, as in the instrucion guide descriped) is wrong written or could not have found.

    I am not experienced in programming in c++ but I think the compiler nmake is missing.

    OS: Windows 7
    Using : Qt 5.14.1 (MSVC 2017 64bit)
    I also have VS 2017 installed with the Desktopdevelopement for C++ and Windows SDK.

    What does I have to install and why?

    Thank you



  • nmake is the MSVC build tool.
    Did you run from "x64 Native Tools Command Prompt for VS 2017"?
    Or you should set the PATH yourself.



  • @Bonnie I run the commands in "Qt 5.14.1 (MSVC 2017 64-bit) and there it says nmake not found.



  • @Flung-Dung Yeah, it only adds Qt's bin to PATH.
    You should have seen a message: Remember to call vcvarsall.bat to complete environment setup!
    It is better to run from "Visual Studio 2017" -> "x64 Native Tools Command Prompt for VS 2017" and then add Qt's bin to PATH.


  • Lifetime Qt Champion

    @Flung-Dung said in Installing mysql for qt:

    cd %QTDIR%\src\plugins\sqldrivers\mysql

    This is wrong and also not written in the documentation


Log in to reply