我按照本教程使用VS2010:Qt - How to get|compile Mysql driver编译mysql驱动程序。
编译失败,错误:LNK1123: failure during conversion to COFF: file invalid or corrupt
我尝试使用mysql和qt的多个版本,我总是得到相同的错误。
注意:我使用的是Qt-4.8.4和MySQL5.5.32-Win 32。
发布于 2013-07-10 09:21:40
我将从源代码重新构建Qt,因为您还需要SQL驱动程序(不仅仅是插件)。
驱动程序源位于/src/sql/驱动器/mysql下面。
插件源位于/src/plugins/src驱动程序下面。
/src/sql/drivers/mysqldrivers.pri包含以下内容:
contains(sql-drivers, all):sql-driver += psql mysql odbc oci tds db2 sqlite ibase contains(sql-drivers, mysql):include($$PWD/mysql/qsql_mysql.pri)
因此,我认为在编译Qt之前,您需要使用以下选项运行configure:-qt-sql-mysql和-plugin-sql-mysql。
重新编译Qt
cd \qtdirnmake distcleanconfigure -debug-and-release -platform win32-msvc2010 -mp -nomake examples -nomake demos -qt-sql-mysql -plugin-sql-mysqlnmake您可能需要将configure指向正确的MySQL包含/库目录,方法是添加以下选项:-I "c:\path\to\mysql\include"和-L "c:\path\to\mysql\lib"
https://stackoverflow.com/questions/17566483
复制相似问题