How to link mysql library with the c++ program?

Codes here !

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 22
Joined: Wed May 02, 2012 5:27 am

Mon Jun 04, 2012 8:24 pm


I have used created my database application in c++ by using mysql connector c++. Now make a wrapper file, so that I will use use that in my php web appliction. For wrapping it I have used SWIG, but when I complie it with the command that mention below

[root]# c++ -fpic -c test_wrap.cpp DBConn.cpp -I/usr/include/php/Zend/ -I/usr/include/php/TSRM/ -I/usr/include/php/main -I/usr/include/php/

DBConn.h:130:9: error: ‘Driver’ does not name a type
DBConn.h:131:9: error: ‘Connection’ does not name a type
DBConn.h:132:9: error: ‘Statement’ does not name a type
DBConn.h:133:9: error: ‘PreparedStatement’ does not name a type
DBConn.h:134:3: error: ‘ResultSet’ does not name a type

I got the above error.

So please tell me how to link with mysql library from cli because I tried it so much.



php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Fri Jun 15, 2012 1:28 pm

This is more a forum about using PHP and MySQL, you would be better off finding a c++ forum for this query I think.

Post Reply