I would like to develop a application in c++ in which I want to use MySQL for storing data in my database. I am connecting to the database through "MySQL C++ connector 1.1.3" library....

The problem is that when the "driver->connect(--parameters--)" function is executed, the program crashes. I'm sure that the program crashes while executing this function because I've checked it by using suitable output statements...

I have already downloaded the C++ connector and set the required options in the IDE. So, there is no problem with compilation and the program building properly as well....

I'm using code::blocks 12.11 as my IDE and MinGW 4.7.1 as my compiler...

I didn't install MySQL separately. Instead, I installed the XAMPP package, of which MySQL is a part.

I feel that the error is because the program is not able to access the MySQL database because it is not installed as MySQL instead its a part of XAMPP package.

Now, I don't want to install the MySQL server separately. I want to continue with the XAMPP package itself....

Chief Justice: We have trouble dear citizens!Citizens: What it is his honor?Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

Well, it's been quite a long time since I have posted this thread. I didn't get a reply for a long time. So, I tried finding it out myself and found that it was because the libmysql.dll file that is required for accessing the database was built using visual c++. But I was using mingw. Hence, I decided to go with mysql++. I have successfully built it and have been able to build programs performing required operations successfully. Anyway, I thank you for your reply and I appreciate that you did reply.

Nishal wrote:Well, it's been quite a long time since I have posted this thread. I didn't get a reply for a long time. So, I tried finding it out myself and found that it was because the libmysql.dll file that is required for accessing the database was built using visual c++. But I was using mingw. Hence, I decided to go with mysql++. I have successfully built it and have been able to build programs performing required operations successfully. Anyway, I thank you for your reply and I appreciate that you did reply.

Sorry that no body had responded. Thats the way volunteer driven forums are.
Glad that you resolved it.
wxEnjoyIt!

Chief Justice: We have trouble dear citizens!Citizens: What it is his honor?Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

I would be glad if you could show me a step by step way of using the mysql++ library. I have built the library on mingw and have been able to connect to a database successfully. unfortunately, i connected to the database in a different way, my declaring a pointer to the Connection object. i.
mysqlpp::Connection *conn = new mysqlpp::Connection;
if i try to do it the usual way, i. e. mysqlpp::Connection con; app crashes.
even though the pointer works well for a successful connection. executing a query also crashes all the time. all the example programs crash. i don't know why, maybe you can give me an insight since i believe you are now familiar with the library.
Thanks in advance.

rafsanmoney wrote:I would be glad if you could show me a step by step way of using the mysql++ library. I have built the library on mingw and have been able to connect to a database successfully. unfortunately, i connected to the database in a different way, my declaring a pointer to the Connection object. i.
mysqlpp::Connection *conn = new mysqlpp::Connection;
if i try to do it the usual way, i. e. mysqlpp::Connection con; app crashes.
even though the pointer works well for a successful connection. executing a query also crashes all the time. all the example programs crash. i don't know why, maybe you can give me an insight since i believe you are now familiar with the library.
Thanks in advance.

Chief Justice: We have trouble dear citizens!Citizens: What it is his honor?Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

rafsanmoney wrote:i opened the url and it looks like there are just source files there. should i take them and build myself or what? can you give me a little walkthrough?

I was waiting for someone who had bakefiles and said would contribute. Since he had not, I need to write them and will do that when I have time.
For now you have to include sources and put right switches to your library and build it. Which backed do you plan to use? MySQL only? Which IDE do you use?

Chief Justice: We have trouble dear citizens!Citizens: What it is his honor?Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]