qt creator包含 lib 库 (怎么包含库lib 文件)

ps:我的程序只有两行代码MYSQLmysql;mysql_init(&mysql);只要我注释掉mysql_init(&mysql);就不会跳出了```````````... ps : 我的程序只有两行代码
MYSQL mysql; mysql_init(&mysql);
只要我注释掉 mysql_init(&mysql);
就不会跳出了``````
``````````````````````````````````````````
怎么包含libmysql.lib
总是提示exited with code -1073741515
我只是想调用mysql 的api
```````````````````````````````````````````````````````````
于是有下图的样子

提示exited with code -1073741515
``````````````````````````````````````````````````````````````````````````````
以下是我寻找问题的各种答案的过程`````
希望大家看完````````````````````````````````````````````

于是我google 一下在https://qt-project.org/forums/viewthread/14724
http://qt-project.org/forums/viewthread/35376
找到了一样的问题

下面的解答都说是包含库文件包含错了
````````````````````````````````````````````````
以下是他们解答

可是我的包含的头文件有错吗```````````````````````

一下是我的pro文件

就是这个
`````````````````````````````````````````````````````````````````
#-------------------------------------------------## Project created by QtCreator 2014-06-18T08:23:18##-------------------------------------------------QT += coreQT -= guiTARGET = mysqlconsuleCONFIG += consoleCONFIG -= app_bundleTEMPLATE = appSOURCES += main.cppINCLUDEPATH += D:/mysql/new/includeDEPENDPATH += D:/mysql/new/includeLIBS +=D:/mysql/new/lib/libmysql.lib

``````````````````````````````````````````````````````````````````````````````````````````
注释掉哪一个mysql_init(&mysql); 就不会跳出了`````````

求助好的加分``````````````````````
INCLUDEPATH += D:/mysql/new/includeDEPENDPATH += D:/mysql/new/includeLIBS += D:/mysql/new/lib/libmysql.lib
这个是我的pro 文件

我的mysql的库的位置


里面的lib位置是

我的mysql.h的位置
展开
 我来答
fengshh1383
推荐于2017-10-01 · TA获得超过331个赞
知道小有建树答主
回答量:126
采纳率:100%
帮助的人:130万
展开全部
pro文件里LIBS+=那一行改成如下试试:

LIBS += -LD:/mysql/new/lib -llibmysql
-L后面是库的路径,-l后面是库名称
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式