eclipse+c连接mysql数据库连接,无法在Eclipse中使用C ++连接MySQL数据库

本文档指导如何在Eclipse中正确配置C++与MySQL Connector,解决编译时出现的警告和链接错误,包括#pragma warning处理和路径设置问题。附带了错误截图和修复建议,适合初学者跟随学习。
摘要由CSDN通过智能技术生成

My Aim is to connect the C++ code to my database and update some information so i follow many Articles but none is solve my Problem..

Here is the Problem...

First I download the Boost,Mysql Server,C++ Connector and include in the eclipse but i think i did something Wrong because when i execute my Code such error is Shown check Screenshot:1 and Screenshot:2

Please Anyone Suggest me the Tutorial of Setup Eclipse C++

bnMBp.png

7HdBQ.png

for the Code i followed the Below Link:

Here

Here is my Console output:

12:14:54 **** Incremental Build of configuration Debug for project C++_dev ****

Info: Internal Builder is used for build

g++ "-IC:\\Program Files\\MySQL\\Connector.C++ 1.1\\include" "-IC:\\Program Files\\MySQL\\MySQL Server 5.7\\include" "-IC:\\Software\\boost_1_61_0" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\C++_dev.o" "..\\src\\C++_dev.cpp"

In file included from C:\Program Files\MySQL\Connector.C++ 1.1\include/cppconn/connection.h:33:0,

from C:\Program Files\MySQL\Connector.C++ 1.1\include/mysql_connection.h:30,

from ..\src\C++_dev.cpp:14:

C:\Program Files\MySQL\Connector.C++ 1.1\include/cppconn/warning.h:40:0: warning: ignoring #pragma warning [-Wunknown-pragmas]

#pragma warning (disable : 4290)

^

In file included from C:\Program Files\MySQL\Connector.C++ 1.1\include/cppconn/variant.h:38:0,

from C:\Program Files\MySQL\Connector.C++ 1.1\include/cppconn/connection.h:35,

from C:\Program Files\MySQL\Connector.C++ 1.1\include/mysql_connection.h:30,

from ..\src\C++_dev.cpp:14:

C:\Program Files\MySQL\Connector.C++ 1.1\include/cppconn/exception.h:48:0: warning: ignoring #pragma warning [-Wunknown-pragmas]

#pragma warning (disable : 4290)

^

C:\Program Files\MySQL\Connector.C++ 1.1\include/cppconn/exception.h:52:0: warning: ignoring #pragma warning [-Wunknown-pragmas]

#pragma warning(push)

^

C:\Program Files\MySQL\Connector.C++ 1.1\include/cppconn/exception.h:53:0: warning: ignoring #pragma warning [-Wunknown-pragmas]

#pragma warning(disable: 4275)

^

C:\Program Files\MySQL\Connector.C++ 1.1\include/cppconn/exception.h:58:0: warning: ignoring #pragma warning [-Wunknown-pragmas]

#pragma warning(pop)

^

g++ "-LC:\\Program Files\\MySQL\\Connector.C++ 1.1\\lib\\opt" "-LC:\\Program Files\\MySQL\\MySQL Server 5.7\\lib" -o C++_dev.exe "src\\C++_dev.o" "-lC:\\Program" "Files\\MySQL\\MySQL" Server "5.7\\lib\\mysqlclient.lib"

g++: error: Files\MySQL\MySQL: No such file or directory

g++: error: Server: No such file or directory

g++: error: 5.7\lib\mysqlclient.lib: No such file or directory

解决方案

It's not a code error, it's just that you misconfigured the MySQL connector in Eclipse.

You should be able to adapt this tutorial to your needs:

Just focus on how to link OpenCV libraries and it's the same (but paths) for MySQL

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值