Results 1 to 2 of 2

Thread: QMYSQL Plugin does not compile

  1. #1
    Join Date
    Apr 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QMYSQL Plugin does not compile

    I tried the instructions to compile and build the MYSQL Plugin using the known instructions:
    How to Build the QMYSQL Plugin on Windows

    You need to get the MySQL installation files. Run SETUP.EXE and choose "Custom Install". Install the "Libs & Include Files" Module. Build the plugin as follows (here it is assumed that MySQL is installed in C:\MySQL):

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

    If you are not using a Microsoft compiler, replace nmake with make in the line above.

    Note: This database plugin is not supported for Windows CE.

    Note: Including "-o Makefile" as an argument to qmake to tell it where to build the makefile can cause the plugin to be built in release mode only. If you are expecting a debug version to be built as well, don't use the "-o Makefile" option.

    However, when do compile by changing nmake to make then I get the error:
    C:\Qt\2009.01\qt\src\plugins\sqldrivers\mysql>C:\Q t\2009.01\qt\qmake\qmake "INCL
    UDEPATH+=C:\Program Files\MySQL\MySQL Server 5.1\include" "LIBS+=C:\Program File
    s\MySQL\MySQL Server 5.1\lib\opt\LIBMYSQL.LIB" C:\Qt\2009.01\qt\src\plugins\sqld
    rivers\mysql\mysql.pro make
    Could not find mkspecs for your QMAKESPEC(win32-g++) after trying:
    C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_cre
    ate_more/Troll/4.5.0/qt\mkspecs
    Error processing project file: C:/Qt/2009.01/qt/src/plugins/sqldrivers/mysql/mys
    ql.pro
    Cannot find file: make.

    The c:\qt-greenhouse directory does not exist on my machine therefore, what should have been the correct path relative to my machine?

  2. #2
    Join Date
    Apr 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QMYSQL Plugin does not compile

    Well, for those out there that still had an issue building a plugin especially with MySQL, I was able to successfully compile my plugin and successfully connect to MySQL Server. To make things easier I put the commands into a batch file:

    call C:\Qt\2009.01\bin\qtenv.bat
    C:\Qt\2009.01\qt\qmake\qmake "INCLUDEPATH+=C:\MYSQL\include" "LIBS+=C:\MYSQL\lib\opt\libmysql.lib" mysql.pro
    make
    pause


    1. Download junction v1.04 and set up a symbolic link between c:\qt and C:\qt-greenhouse\Trolltech\code_less_create_more\Trollte ch\code_less_create_more\Troll\4.5.0 to avoid a bug in the hard coded QT DLLs that physically look for your QT location in the qt-greenhouse directory and subdirectories.
    2. Furthermore, the issue was in long path names with spaces therefore, I moved the include & lib paths from the root path "C:\Program Files\MySQL\MySQL Server 5.1" to "C:\MYSQL" simply.
    3. I added a call to the batch file qtenv.bat located on my machine call "C:\Qt\2009.01\bin\qtenv.bat" that sets up my environment variables before calling qmake and make commands.
    4. This was my misunderstanding on my part but, in the documentation I assumed the call to make or nmake was the last parameter of qmake (assuming you are looking at documentation with word wrap). But, once I set a call to make on the next line after qmake then, everything fell into place.


    The first and second points were the key for me, it seems like long file paths do not get parsed correctly left as is, I did not try but, it seems like you need to qualify folder names with spaces and I was not doing that. I am not sure yet if QT 4.5.0 has the means to qualify the folder name. Also, to get past the linking with c:\qt-greenhouse solved the issue immensely.

    Well that is all, I hope this helps someone out there with the same issues.
    Last edited by mmaayeh; 24th April 2009 at 07:52.

Similar Threads

  1. Qt plugin compile once
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 28th January 2009, 00:35
  2. Plugin implementation question
    By JPNaude in forum Qt Programming
    Replies: 12
    Last Post: 27th August 2008, 20:24
  3. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  4. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02
  5. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.