kAnNaN
kAnNaN

Reputation: 3679

Connecting mysql in c++ using eclipse?

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 :)

Upvotes: 2

Views: 1612

Answers (2)

King Linux
King Linux

Reputation: 357

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

Upvotes: 1

Nathan Wehr
Nathan Wehr

Reputation: 26

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.

Upvotes: 1

Related Questions