首页| 论坛| 消息

回复: Qt4 OpenSource for mingw中编译MySQL驱动
#51 [genesislive 04-23 00:02]
你好,我从别人那里拿到编译好的库,可是构建使用MySQSL 程序的debug版本总是不成功,构建release版本却可以。怎样才能编译debug版本?
#52 [20091965 05-07 22:41]
c:/MYSQL/INCLUDE/mysql.h:800: error: `my_ulonglong' has not been declared
c:/MYSQL/INCLUDE/mysql.h:800: error: ISO C++ forbids declaration of `offset' wit
h no type
c:/MYSQL/INCLUDE/mysql.h:801: error: expected constructor, destructor, or type c
onversion before "mysql_stmt_num_rows"
c:/MYSQL/INCLUDE/mysql.h:802: error: expected constructor, destructor, or type c
onversion before "mysql_stmt_affected_rows"
c:/MYSQL/INCLUDE/mysql.h:803: error: expected constructor, destructor, or type c
onversion before "mysql_stmt_insert_id"
c:/Program Files/Microsoft Visual Studio/VC98/include/ostream: In member functio
n `std::basic_ostream& std::basic_ostream::put(_E) ':
c:/Program Files/Microsoft Visual Studio/VC98/include/ostream:373:instantiate
d from here
c:/Program Files/Microsoft Visual Studio/VC98/include/ostream:235: error: 'struc
t std::basic_streambuf' has no member named 'sput
c'
c:/Program Files/Microsoft Visual Studio/VC98/include/ostream: In member functio
n `std::basic_ostream& std::basic_ostream::put(_E) ':
c:/Program Files/Microsoft Visual Studio/VC98/include/ostream:379:instantiate
d from here
c:/Program Files/Microsoft Visual Studio/VC98/include/ostream:235: error: 'struc
t std::basic_streambuf' has no member named
'sputc'
c:/Program Files/Microsoft Visual Studio/VC98/include/xstring: In member functio
n `void std::basic_string::resize(int) ':
../../../../include/QtCore/../../src/corelib/tools/qstring.h:995:instantiated
from here
c:/Program Files/Microsoft Visual Studi ..
#53 [小文 08-15 11:49]
不行啊... 有这个错误。但是用正斜杠的话。到最后编译貌似没错。但是在文件下没有dll文件只有qsqlmysqld.prl 和libqsqlmysqld.a这个文件啊。求指教。
#54 [zheguzai 09-24 12:47]
QtSDK1.2.1 + MySQL5.5,特么的mysql的驱动都编译了,也拷贝过去了,运行程序的时候,报打开数据库失败,看了一下错误,报的是Driver not loaded Driver not loaded
db = new QSqlDatabase();
db->addDatabase("QMYSQL");
db->setHostName("localhost");
db->setDatabaseName("MySQL");
db->setUserName("root");
db->setPassword("1111");
QSqlError err;
if (!db->open())
{
qDebug()
#55 [wangshengyin 10-22 17:48]
大大 ,我还是不行哦,帮我看看。
win7 64 qt5.1 mysql5.6

我已经生成 libmysql.a 文件

在C:\qt-everywhere-opensource-src-5.0.2\qtbase\src\plugins\sqldrivers\mysql目录下
手动修改mysql.pro 添加

INCLUDEPATH += "C:\mysql\include"
LIBS+= "C:\mysql\lib\libmysql.a"

然后用MinGW 4.8 32 bit
qmake -o kefile mysql.pro

然后
mingw32-make

以下是最后提示:

c:/qt/qt5.1.1/tools/mingw48_32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../..
/i686-w64-mingw32/bin/ld.exe: cannot find -llibmysql
collect2.exe: error: ld returned 1 exit status
Makefile.Release:80: recipe for target '..\..\..\..\plugins\sqldrivers\qsqlmysql
.dll' failed
mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlmysql.dll] Error 1
mingw32-make[1]: Leaving directory 'C:/qt-everywhere-opensource-src-5.0.2/qtbase
/src/plugins/sqldrivers/mysql'
makefile:38: recipe for target 'release-all' failed
mingw32-make: *** Error 2

有人懂吗? 我的qq:171741688 帮帮我吧

<< 9 10 11 12 >> (11/12)

回复 发表
主题 版块