• 8022阅读
  • 2回复

windows下 编译qt的mysql驱动的nmake总出错 [复制链接]

上一主题 下一主题
离线jinyu
 
只看楼主 倒序阅读 楼主  发表于: 2009-03-30
— 本帖被 XChinux 从 General Qt Programming 移动到本区(2011-01-02) —
我下载的是官方的qt的sdk,mysql也正常,
参照 qt的帮助文档sql-driver.html中是这样说的
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):

cd %QTDIR%\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
nmake
If 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.

第2各命令行我改用我实际的mysql的include,lib路径
qmake "INCLUDEPATH+=C:\mysql\mysql-5.0.22-win32\include" "LIBS+=C:\mysql\mysql-5.0.22-win32\lib\opt\libmysql.lib" mysql.pro
执行完全正常。最后的编译nmake总失败(nmake路径没问题,已经设了环境变量,可以使用该命令)
nmake:fatal error U1073:不知道如何生成"c:/Program\"
stop.
nmake:fatal error U1077: "D:\visual studio 2005\vc\bin\nmake.exe"返回代码"0x2" stop

换用make 也失败
make[1] [tmp/obj/debug_shared/main.o] Error 1
leaving directory 'd:\qt\src\plugins\sqldrivers\mysql'
什么原因呢??
离线neu_sunlei

只看该作者 1楼 发表于: 2009-12-28
我也出现这个错误了,关注,谁来回答一下啊
人之初,性本善。性相近,习相远。苟不教,性乃迁。教之道,贵以专。
离线245928944

只看该作者 2楼 发表于: 2010-11-27
需要的编译命令在带有空格的目录下 nmake编译不了, 你的nmake在d:visual studio 2005下 把目录上带有空格的文件名改一下再试下;
快速回复
限100 字节
 
上一个 下一个