i'am using a Windows x64, i need to use Mysql 8 in QT 5.14.2( MinGW x64)
i've started installing MySQl driver as indicated :
2- then when, I am using:
cd $QTDIR/qtbase/src/plugins/sqldrivers/mysql
3- and run:
qmake -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Server 8.0\include" "MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Server 8.0\lib"
I'm getting :
Project ERROR: Library 'mysql' is not defined.
in the log file it shows me that there's a missing file sybfront.h anyone knows how to solve this please
You should replace '\' by '/', either paths will be invalid, even on Windows.
And one quote " is not closed in your code.
qmake parameters follows the same rules as pro file contents:
https://doc.qt.io/qt-5/qmake-project-files.html
Related
I am attempting to use clsql-mysql on the Windows platform. I am using 32 bit Clozure CL with the 32 bit MySQL Connector library (from Oracle) to provide the external library.
I added the path of the connector to %path% so that clsql could find the connector library, and connecting to the database with
(clsql:connect '("host" "db" "user" "pw"))
Which goes without a hitch and returns a <MYSQL_DATABASE> object.
When I attempt to do a simple SQL query, however, I get the following error:
;; Query
(clsql:query "select * from logentry where id = 3346;")
;; Error:
`Can't resolve foreign symbol "clsql_mysql_field_flags"`
Could this be something to do with the way that the mysql connector is compiled? from the INFO_BIN file supplied with the MySQL Connector:
===== Information about the build process: =====
Build was run at Thu 07/13/2017 on host 'VITRO50'
Build was done on Windows-6.2 using AMD64
Build was done using cmake 3.2.3
===== Compiler / generator used: =====
Visual Studio 14 2015
Pointer size: 4
===== Feature flags used: =====
-- Cache values
CANDLE_EXECUTABLE:FILEPATH=C:/Program Files (x86)/WiX Toolset v3.10/candle.exe
CMAKE_CONFIGURATION_TYPES:STRING=DebugReleaseMinSizeRelRelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/LibMySQL
COMMUNITY_BUILD:BOOL=ON
DEBUG_EXTNAME:BOOL=ON
ENABLED_PROFILING:BOOL=ON
ENABLE_DEBUG_SYNC:BOOL=ON
ENABLE_GCOV:BOOL=OFF
ENABLE_GPROF:BOOL=OFF
EXTRA_INSTALL:BOOL=G:\ade\build\sb_0-24199034-1499945748.28/mysql-connector-c-6.1.11-vs12-win32/lib/mysqlclient.liblib/vs12DevelopmentG:\ade\build\sb_0-24199034-1499945748.28/mysql-connector-c-6.1.11-vs12-win32/lib/debug/mysqlclient.liblib/vs12/debugDebugBinariesG:\ade\build\sb_0-24199034-1499945748.28/mysql-connector-c-6.1.11-vs14-win32/lib/mysqlclient.liblib/vs14DevelopmentG:\ade\build\sb_0-24199034-1499945748.28/mysql-connector-c-6.1.11-vs14-win32/lib/debug/mysqlclient.liblib/vs14/debugDebugBinaries
FEATURE_SET:STRING=community
HEAT_EXECUTABLE:FILEPATH=C:/Program Files (x86)/WiX Toolset v3.10/heat.exe
INSTALL_LAYOUT:STRING=STANDALONE
LIGHT_EXECUTABLE:FILEPATH=C:/Program Files (x86)/WiX Toolset v3.10/light.exe
MYSQL_DATADIR:PATH=C:/Program Files/MySQL/MySQL Server 6.1/data
MYSQL_KEYRINGDIR:PATH=C:/Program Files/MySQL/MySQL Server 6.1/keyring
MYSQL_MAINTAINER_MODE:BOOL=OFF
PKG_INSTALL_PREFIX:PATH=C:/Program Files (x86)/LibMySQL
TMPDIR:PATH=
WIN_DEBUG_NO_INLINE:BOOL=OFF
WITH_ARCHIVE_STORAGE_ENGINE:BOOL=ON
WITH_ASAN:BOOL=OFF
WITH_BLACKHOLE_STORAGE_ENGINE:BOOL=ON
WITH_CLIENT_PROTOCOL_TRACING:BOOL=ON
WITH_DEBUG:BOOL=OFF
WITH_DEFAULT_COMPILER_OPTIONS:BOOL=ON
WITH_DEFAULT_FEATURE_SET:BOOL=ON
WITH_EMBEDDED_SERVER:BOOL=ON
WITH_EXTRA_CHARSETS:STRING=all
WITH_FEDERATED_STORAGE_ENGINE:BOOL=ON
WITH_INNOBASE_STORAGE_ENGINE:BOOL=ON
WITH_MSAN:BOOL=OFF
WITH_MSCRT_DEBUG:BOOL=OFF
WITH_NUMA:BOOL=ON
WITH_PARTITION_STORAGE_ENGINE:BOOL=ON
WITH_SSL:STRING=bundled
WITH_TEST_TRACE_PLUGIN:BOOL=OFF
WITH_UBSAN:BOOL=OFF
WITH_UNIT_TESTS:BOOL=OFF
WITH_ZLIB:STRING=bundled
WIX_DIR:PATH=C:/Program Files (x86)/WiX Toolset v3.10
===== EOF =====
The only hits I could find when searching for this error were ones that relate to a similar issue on Ubuntu.
How do I start to debug this error, or how do I fix this error so that the SQL query completes without error?
I'm porting my project from qt4.8.4 on windows server 2003(32bit) to qt5.3.1 on win7(64bit), I build qt source statically, and build qsqlmysql dynamically, but my code can not load mysql qt driver. The error is like follows,
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers:()
My code is as follows,
db = QSqlDatabase::addDatabase("QMYSQL", "*****");
db.setHostName("*****");
db.setDatabaseName("*****");
db.setUserName("*****");
db.setPassword("*****");
When I search "QMYSQL" in registry, I get nothing, it seems qmysql driver is not registered.
Any ideas?
A default configuration will only give you sqlite support, maybe ODBC will be auto-detected on windows. You will need to specify sql support and possibly provide libs and include paths too. For example (using mardiadbclient for mysql):
Pre Qt 5.8:
-qt-sql-mysql -L E:\msys64\mingw64\lib -l mysqlclient -I E:\msys64\mingw64\include\mariadb
Post Qt 5.8:
-sql-mysql MYSQL_INCDIR=E:\msys64\mingw64\include\mariadb MYSQL_LIBDIR=E:\msys64\mingw64\lib MYSQL_LIBS="-l mysqlclient" -L
E:\msys64\mingw64\lib
in qt4.8.4, when you link qsqlmysql statically, you should write:
Q_IMPORT_PLUGIN(qsqlmysql)
but in qt5.3.1, the name changed, you should write the macro as following:
Q_IMPORT_PLUGIN(QMYSQLDriverPlugin)
That's why i always get a unresolved external... error. After change the name, i can link mysql successfully.
I was trying to build my app on linux using mysql c api, and got this error at link stage, it's working fine on windows. Please help, thanks!
error message:
/bin/ld: myapp.so : version node not found for symbol mysql_select_db#libmysqlclient_16
/bin/ld: failed to set dynamic section sizes: Bad value
OS: CentOS 7, 64-bit, (VM on virtual box)
Mysql: 5.6.24 (community edition, installed via yum)
.bashrc file
export LIBMYSQL_INCLUDE_DIR=/usr/include/mysql
export LIBMYSQL_LIBRARY=/usr/lib64/mysql
export LD_LIBRARY_PATH=/usr/lib64/mysql:$LD_LIBRARY_PATH
cmake file: (variables are set according to environment variables)
FILE(GLOB SRC_MYAPP myapp/*.c myapp/*.h)
INCLUDE_DIRECTORIES(${LIBMYSQL_INCLUDE_DIR})
ADD_LIBRARY(myapp ${SRC_MYAPP})
IF (MSVC_IDE)
TARGET_LINK_LIBRARIES(myapp ${LIBMYSQL_LIBRARY}/libmysql)
ELSE ()
TARGET_LINK_LIBRARIES(myapp ${LIBMYSQL_LIBRARY}/libmysqlclient_r.a)
ENDIF ()
Put #hank 's comment as answer
I suppose you should add link_directories(/usr/lib64/mysql) before add_library and then target_link_libraries(myapp mysqlclient_r) – hank May 12 at 12:50
I followed this tutorial to compile mysql driver with VS2010 :
Qt - How to get|compile Mysql driver.
The compilation fails with the error : LNK1123: failure during conversion to COFF: file invalid or corrupt
I tried with with multiple versions of mysql and qt, i always get the same error.
Note: I am using Qt-4.8.4 and mysql-5.5.32-win32.
I would rebuild Qt from source, because you also need the SQL driver (not only the plugin).
The driver source is located under /src/sql/drivers/mysql
The plugin source is located under /src/plugins/sqldrivers
/src/sql/drivers/mysqldrivers.pri contains this:
contains(sql-drivers, all):sql-driver += psql mysql odbc oci tds db2 sqlite ibase
contains(sql-drivers, mysql):include($$PWD/mysql/qsql_mysql.pri)
So I think that you need to run configure with the options: -qt-sql-mysql and -plugin-sql-mysql before compiling Qt.
Recompile Qt
Open a Qt 4.8.4 Command Prompt
cd \qtdir
nmake distclean
configure -debug-and-release -platform win32-msvc2010 -mp -nomake examples -nomake demos -qt-sql-mysql -plugin-sql-mysql
nmake
You might need to point configure to the correct include/library directory for MySQL, by adding this options: -I "c:\path\to\mysql\include" and -L "c:\path\to\mysql\lib"
Trying to install RMySQL on 64-bit Windows 7.
Using R-2.14.2 with Rtools214 and MySQL Server 5.5.
Read through several step-by-steps of RMySQL source installation.
Troubleshooting:
- Copied libmysql.dll to R-2.14.2/bin AND R-2.14.2/bin/i386.
- Copied libmysql.dll and libmysql.lib to MySQL Server 5.5\lib\opt.
- Entered MYSQL_HOME=C:\Program Files\MySQL\MySQL Server 5.5 into Renviron.site, saved to R\R-2.14.2\etc.
My instances of common problems:
Sys.getenv('MySQL_HOME')
[1] "C:\Program Files\MySQL\MySQL Server 5.5\"
install.packages('RMySQL', type = 'source')
Installing package(s) ...
...
RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
make: [RS-DBI.o] Error 1*
ERROR: compilation failed for package 'RMySQL'
...
I'm guessing my problem lies in the '64-bit mode...' message, but I'm not sure.
Thoughts?
I'm not sure this error message has anything to do with RMySQL, or any particular package.
On 64bit Windows, instead of the default PATH :
C:\Rtools\MinGW\bin
( gives the error sorry, unimplemented: 64-bit mode not compiled in )
you might (quite reasonably) notice the MinGW64 directory alongside and try :
C:\Rtools\MinGW64\bin
but in fact it needs to be :
C:\Rtools\gcc-4.6.3\bin
Then of course, stop and start a new DOS window to pick up the new PATH.
I had problems installing RMySQl
so I installed the package RODBC which works fine.
(make sure the MySQL driver is installed).
http://dev.mysql.com/downloads/connector/odbc/