致命错误:mysql.h:没有这样的文件或目录

时间:2017-03-26 16:11:37

标签: c++ mysql qt

操作系统:Windows 10

您好,真的希望有人可以提供帮助,因为我正在拼命尝试安装QMYSQL驱动程序。我知道有很多关于这个的帖子,但我的问题仍然没有解决,我真的不知道为什么...我的mysql.h文件肯定存在,因此它的路径是为include提供的。我有最新版本的Qt(带源代码的5.8)和MySql(5.7)。在mysql安装中,我选择了开发人员默认,安装成功。我很乐意提供进一步的信息。我问任何可以帮助的人。谢谢。

in cmd from:

C:\Qt\5.8\Src\qtbase\src\plugins\sqldrivers\mysql

我跑:

qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 5.7\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 5.7\lib" mysql.pro

然后mingw32-make正常。

我得到:

mingw32-make -f Makefile.Release all
mingw32-make[1]: Entering directory 'C:/Qt/5.8/Src/qtbase/src/plugins /sqldrivers/mysql'
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++1z -fno-exceptions  -frtti -Wall -Wextra
 -Wvla -Wdate-time -DUNICODE -DQT_NO_CAST_TO_ASCII  -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS
 -DQT_NO_DEBUG -DQT_PLUGIN  -DQT_SQL_LIB -DQT_CORE_LIB -I. -IC:\Program -IFiles\MySQL\MySQL
 -IServer  -I5.7\include -IC:\Qt\5.8\mingw53_32\include\QtSql\5.8.0 -IC:\Qt\5.8\mingw53_32
\include\QtSql\5.8.0\QtSql -IC:\Qt\5.8\mingw53_32\include\QtCore\5.8.0 -IC:\Qt\5.8\mingw53_32\include\
QtCore\5.8.0\QtCore -IC:\Qt\5.8\mingw53_32\include -IC:\Qt\5.8\mingw53_32\include\QtSql -IC:\Qt\5.8\
mingw53_32\include\QtCore -I.moc\release -IC:\utils\my_sql\my_sql\include -IC:\utils\postgresql
\pgsql\include -IC:\openssl\include -I..\..\..\..\mkspecs\win32-g++  -o  .obj\release\qsql_mysql.o qsql_mysql.cpp
In file included from qsql_mysql.cpp:40:0:qsql_mysql_p.h:60:19: fatal error: mysql.h: No such file or directory
compilation terminated.
Makefile.Release:355: recipe for 
target '.obj/release/qsql_mysql.o'   failed
mingw32-make[1]: *** [.obj/release/qsql_mysql.o] Error 1
mingw32-make[1]: Leaving directory 
'C:/Qt/5.8/Src/qtbase/src/plugins  /sqldrivers/mysql'
Makefile:38: recipe for target 'release-all' failed
mingw32-make: *** [release-all] Error 2

0 个答案:

没有答案