在c++中连接mysql使用日食?
我正在使用 Eclipse,并且收到错误消息“未解决的包含:mysql_connection.h 以及与 mysql 标头相关的所有 #include 语句以及程序中与 mysql 相关的其他关键字的使用的类似错误。
我已经安装了完整的设置 所以我认为它的链接器
问题是如何在 Eclipse 或其他解决方案中将 mysql 链接到 C++?
错误,我的 Eclipse 中的 C++ 程序,
谢谢:)
I'm using Eclipse, and I get errors saying "Unresolved inclusion: mysql_connection.h and similar errors at all the #include statement related to the mysql headers and usage of other keywords related to mysql in the program.
I have installed the complete setup of the mysql server.
so i think its linker error , my question is that How do I link to mysql to c++ in eclipse or some other solution?
can some pls suggest me the steps or relevant links so that i could run my c++ program in eclipse.
thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我以前从未使用过 Eclipse。但是,您的小错误显示“未解决的包含:mysql_connection.h”表明编译器不知道在哪里可以找到您的头文件。因此,我会仔细检查您的包含路径是否正确。要使用 MySQL Connector/C(我假设这就是您正在使用的...),您还需要链接到两个库:-lmysqlclient 和 -lz。您应该确保您的库包含路径也正确。
一旦所有内容都编译完毕,您可能想查看我为 MySQL 编写的一个简单的 C++ api。 www.nwehr.com ->来源-> NDMySQL。
I have never used Eclipse before. However, your little error that says "Unresolved inclusion: mysql_connection.h" suggests that the compiler has no idea where to find your header files. So, I would double check to see if your include paths are correct. To use MySQL Connector/C (I'm assuming that is what you're using...), you will also need to link to two libraries: -lmysqlclient, and -lz. You should make sure that your library include paths are also correct.
Once you get everything compiling, you might want to check out a simple C++ api that I wrote for MySQL. www.nwehr.com -> Source -> NDMySQL.
看来您遇到了 eclipse CDT 找不到 MySql 库的问题。
关于使用 mysql (Ubuntu) 设置 CDT 最相关的文章是:
CDT 库设置 MySql
It seems though you are having issue with eclipse CDT not finding MySql library's.
The most relevant article about setting up CDT with mysql (Ubuntu) is:
CDT lib setup MySql