求教:QT4.7编译mysql驱动出错?(已解决)

weixin_38052602 2019-09-19 05:17:01
我编译mysql驱动的步骤是:1安装mysql5,把其安装目录下的include及lib文件夹考到G:/mysql目录下2安装Qt Creator (qt-sdk-win-opensource-2010.05.exe)  qt版本4.73设置QT的环境变量,目的是在命令行下能执行qmke及 mingw32-make两个命令。环境变量主要设置了以下两个添加了新环境变量QTDIR=G:/Qt/qt           //我的QT安装目录给原有环境变量PATH添加了新路径:G:\Qt\mingw\bin     //目的是在命令行下能执行mingw32-make4 根据QT帮助文档编译mysql驱动,文档是这样描述的,见附:我的步骤是按照文档来的,在命令行下执行以下命令cd G:\Qt\qt\src\plugins\sqldrivers\mysqlqmake "INCLUDEPATH+=G:\mysql\include" "LIBS+=G:\mysql\lib\opt\libmysql.lib" mysql.promingw32-make编译进行几秒后,出现一大片类似以下的错误:请问一下可能是什么错误,谢谢!G:\software\Qt\qt\src\plugins\sqldrivers\mysql/../../../../include/QtCore/../../src/corelib/tools/qvector.h:115: undefined reference to `_imp___ZN11QVectorData11shared_nullE' 附: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):<PRE cpp? brush:> cd %QTDIR%\src\plugins\sqldrivers\mysqlqmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pronmakeIf 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. 按这里说的步骤就行http://www.qtcn.org/bbs/read-htm-tid-44229.html出现我这里所说的错误主要是可能我装了VS的原故,我把VS卸载了就能编译出来了
...全文
40 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

433

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧