I receive an error when I try to build the QMYSQL plugin for Windows 10.
I have installed Qt 5.12.1 and the path to sql drivers is c:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers and the path to the library files is c:\Program Files\MySQL\MySQL Server 8.0\lib.
I opened a cmd window and typed the folowing:
c:\Qt\Qt5.12.1\5.12.1\mingw73_64\plugins\sqldrivers>qmake -- MYSQL_INCDIR=C:/MySQL/include "MYSQL_LIBDIR=C:/MYSQL/MySQL Server 8.0/lib/" mysql.pro
Now it's work for Qt 5.14.2 (MSVC 2017, 32 bit) on Windows7x64
Since building according official tutorial https://doc.qt.io/qt-5/sql-driver.html#qmysql not work for me, I found a work-around way(https://dev.to/f1r361rd/how-i-build-a-mysql-plugin-for-qt5-windows-mingw32-2kim):
Download MySql MySQL Server 5.1 sources
In file
D:\QT\Qt5.13.1\5.13.1\Src\qtbase\src\plugins\sqldrivers\mysql\mysql.pro
Comment the line QMAKE_USE += mysql
Adding Library path and Include path.
Add the following to mysql.pro at end
LIBS += -L'C:/Program Files (x86)/MySQL/MySQL Server 5.1/lib/opt/libmysql.lib'
-llibmysql
INCLUDEPATH += 'C:/Program Files (x86)/MySQL\MySQL Server 5.1/include'
DEPENDPATH += 'C:/Program Files (x86)/MySQL\MySQL Server 5.1/include/mysql.h'
Execute sequence commands: qmake -> nmake -> nmake install
Related
I have a desktop(ubuntu 14.04 64 bit) QT application which uses libpqxx(c++ library for Postgres). The GUI app is an interface to the postgress database and does a lot of operations. Now, I am trying to port this application to a raspberry pi3. I started with a test QT app. Used cross-compile tool chain to build the test app on desktop and deployed it on pi. It works like a charm. However, when I follow the same steps to deploy my actual app on pi, its giving me compile time error
fatal error: pqxx/pqxx: No such file directory.
I have the library linked in .pro file via -lpqxx -lpq. I have also installed libpqxx on pi3. It works on my desktop with Qt 5.6.1 GCC 64 bit kit but doesn't work on pi with Rpi3 Qt kit. Please help.
New Edit:
I added pqxx library path in my .pro file. It looks like this now :
target.path = /home/pi
INSTALLS +=target
unix: LIBS += -L$$PWD/../../../../../../usr/local/lib/ -lpqxx
INCLUDEPATH += $$PWD/../../../../../../usr/local/include/pqxx
DEPENDPATH += $$PWD/../../../../../../usr/local/include/pqxx
unix: PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/lib/libpqxx.a
The previous error is gone. However, it gives me this error now:
/home/pragya/ep/PHOENIX/GUI/LUXE_GUI/../../../../../../usr/local/lib//libpqxx.a: error adding symbols: File format not recognized
Any Ideas?
I need to compile Qt 3.3.6 on my Win 7 PC to use it in combination with my MSVC2012 C++ compiler (MSVS 2012 Professional).
The simple reason is that I have a Qt 3.3.6 license and a lot of Qt 3.3.6 source code. So, a Qt upgrade is not an option. "Google" does not help...
Edited:16/11/10 1:40 pm
I already tried to compile it by starting a shell via VS2012 (Tools/VisualStudioCommandPrompt) and changing the cwd to the Qt directory containing the appropriate Makefile:
C:\Qt\3.3.6>bin\configure.exe -redo -spec win32-msvc2012
License file not found in C:/Users/mdew
Enterprise modules will not be available.
QMAKESPEC...................win32-msvc
Maketool....................nmake
[...list of all the installed programs...]
Configuration:
nocrosscompiler
dialogs
iconview
kernel
styles
tools
widgets
workspace
minimal-config
small-config
medium-config
large-config
full-config
release
thread
no-gif
zlib
jpeg
mng
png
bigcodecs
no-tablet
Debug symbols...............no
Thread support..............yes
Accessibility support.......no
Big Textcodecs..............yes
Tablet support..............no
STL support.................yes
Additional exports..........no
Exception support...........yes
RTTI support................yes
OpenGL support..............no
Image formats:
GIF support.............no
MNG support.............qt
JPEG support............qt
PNG support.............qt
Styles:
Windows.................yes
Windows XP..............no
Motif...................yes
Platinum................yes
MotifPlus...............yes
CDE.....................yes
SGI.....................yes
Sql Drivers:
ODBC....................no
MySQL...................no
OCI.....................no
PostgreSQL..............no
TDS.....................no
DB2.....................no
SQLite..................no
Interbase...............no
Sources are in..............C:\Qt\3.3.6
Install prefix..............C:\Qt\3.3.6
Headers installed to........C:\Qt\3.3.6\include
Libraries installed to......C:\Qt\3.3.6\lib
Plugins installed to........C:\Qt\3.3.6\plugins
Binaries installed to.......C:\Qt\3.3.6\bin
Docs installed to...........C:\Qt\3.3.6\doc
Data installed to...........C:\Qt\3.3.6
Translations installed to...C:\Qt\3.3.6\translations
Creating qmake...
Microsoft (R) Program Maintenance Utility Version 11.00.61030.0
Copyright (C) Microsoft Corporation. All rights reserved.
cd qmake
NMAKE : fatal error U1077: 'cd' : return code '0x1'
Stop.
Building qmake failed, return code 2
So, my attempt to compile it via MSVS2012 failed. NMAKE gets in trouble.
What am I doing wrong?
Thank you in advance for any hint!
BR mdew
have tried to compile Qt 3.3.6 from source with MSVC2015 and I've success.
Download Qt 3 source from https://sourceforge.net/projects/qtwin/files/Unofficial%20Qtwin/qt-win-3.3.6-6/
you must have QTDIR environment variable
set QTDIR=<your path to Qt 3 folder>
make sure bin folder is in your PATH
set PATH=%QTDIR%\bin;%PATH%
replace PATH_MAX with MAX_PATH in following files:
src\tools\qdir_win.cpp
src\tools\qdir.cpp
comment or remove
#include <winable.h>
from
src\kernel\qaccessible_win.cpp
run
configure.bat --help
configure.exe and link_includes.exe will be generated in bin folder.
cd bin
configure.exe -no-dsp -v
if you get errors saing error C3688: invalid literal suffix 'QTDLL_POSTFIX'
delete all QTDLL_POSTFIX in this files:
qmake\generators\win32\borland_bmake.cpp
qmake\generators\win32\mingw_make.cpp
qmake\generators\win32\msvc_dsp.cpp
qmake\generators\win32\msvc_nmake.cpp
qmake\generators\win32\msvc_vcproj.cpp
and change
QString dllStem = stem + QTDLL_POSTFIX;
to
QString dllStem = stem;
in
qmake\generators\win32\winmakefile.cpp
rerun
configure.exe -no-dsp -v
it should now compile successfully
I have compiled qmysql driver plugin and placed debug and release .dll and .lib files in \plugins\sqldrivers. But when i try qDebug() << QSqlDatabase::drivers(); it still get ("QSQLITE", "QODBC3", "QODBC", "QPSQL7", "QPSQL")and QMYSQL driver is not available.Any idea?
Qt version : 4.8.4
Compiler : MSVC2010
OS : windows vista (64bit)
Your application needs libmysql.dll which you can find in the MySQL installation directory. You can copy it to the Qt bin directory or in the same directory of your .exe
Note that you need to restart your IDE (Qt Creator or what ever IDE) after you place new dll files in \plugins\sqldrivers or Qt bin directory.
I've downloaded and installed the QT SDK and downloaded the QT Mobility source.
Following the provided instructions, I navigated to my QtMobility directory via the Visual Studio Command Prompt (2010)... note, this is the QtMobility dir with the bin, plugins, examples, etc. folders.
D:\
cd D:\Files\Downloads\QtMobility
configure
Regardless of whether I gave configure a -prefix parameter or not, the following output was displayed:
Checking available Qt
4.8.2
Checking make
... Unknown target environment .
Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH
Aborting.
Of course, I then went to see if my computer had nmake in its PATH: the directory is added as follows:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
I went to CMD and typed in "nmake /?" to receive proper output.
What am I doing wrong? When I try to simply run nmake in the QTMobility directory, it displays:
NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.
Help, please! Thank you. :) I will continue attempting debugs on my own...
I suppose this is late but you could simply run the visual studio command prompt, as it has specific env. variables preset to find nmake, etc.
I need to have a cmd build script to address x86 x64 compilation issue associated with the IDE (i mean switching qt versions & rebuilding). The problem is that, in my .pro file, I add dependency on external library in this way:
LIBS += ../Libs/SomeExternal.lib
Now when I build this project from QtCreator, everything compiles and builds fine, but when I try to build using command prompt + qmake I get the following linker error:
LINK : fatal error LNK1104: cannot open file '../Libs/SomeExternal.lib'
I understand that this issue is related to paths, but I don't know how to let LINKER.exe see the location where my project is located. Just like QtCreator does.
I try to build using the following way:
I run VS command prompt. I'm using MSVC compiler.
I type qmake.exe -project C:\ProjectPath\Project.pro
nmake
Thanks
Use:
LIBS += -L$${PWD}/../Libs -lSomeExternal
From the documentation:
The PWD variable specifies the full path leading to the directory
containing the current file being parsed.