mysql 编译驱动 mingw32-make main.o_Qt - 如何获取|编译Mysql驱动程序

Qt中集成MySql教程
本文详细介绍了如何在Qt环境中为应用程序集成MySql驱动程序,包括配置步骤和编译指令,适用于希望在Windows平台Qt-4.7.2上使用MySql作为数据库的应用开发。

我正在尝试在Qt中创建一个依赖MySql的应用程序。一段时间后,我开始知道我的共享内部版本没有MySql驱动程序(默认情况下)。任何人都可以说如何获得它(共享和静态)。

注意:我在Windows平台上使用Qt-4.7.2

编辑:

感谢“vrince”。这是他展示的方式=>我做过的。

1)Open qt-command prompt

2)Goto (Qt's installation path)\qt\src\plugins\sqldrivers\mysql

in my case:

D:\TempInstallationFolder\Qt\dynamic-New\qt\src\plugins\sqldrivers\mysql

3)qmake

4)make

or

mingw32-make (provided your PATH variable contains "(Qt installation path)\mingw\bin")

("make" should work if you didn't mess up with path variables. It in turn

invokes mingw32-make. I messed up this a little bit. So I invoked

mingw32-make directly.)

5)In the above command you have to indicate the mysql's "lib" path,

and "include" path through the compile flag options. Or Add those lines

in the pro file like below

INCLUDEPATH += "C:\Program Files\MySQL\MySQL Server 5.1\include"

LIBS += -L"C:\Program Files\MySQL\MySQL Server 5.1\lib\opt"而已。你可以找到这些dll

(Qt-安装路径)\ qt \ plugins \ sqldrivers

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值