Click here to Skip to main content
15,917,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When use MySQL with Visual Studio (C++) by following the instructions at :

http://dev.mysql.com/doc/refman/5.6/en/connector-cpp-apps-windows-visual-studio.html[^]

and type in these commands :

C#
sql::mysql::MySQL_Driver *driver;
    sql::Connection *con;

    driver = sql::mysql::MySQL_Driver::get_mysql_driver_instance();
    con = driver->connect("tcp://127.0.0.1:3306", "user", "password");

    delete con;


, i receive the following error :

Error	3	error C2653: 'sql' : is not a class or namespace name	
Error	4	error C2065: 'MySQL_Driver' : undeclared identifier	
Error	5	error C2065: 'driver' : undeclared identifier	
Error	6	error C2653: 'sql' : is not a class or namespace name	
Error	7	error C2065: 'Connection' : undeclared identifier	
Error	8	error C2065: 'con' : undeclared identifier	
Error	9	error C2065: 'driver' : undeclared identifier	
Error	10	error C2653: 'sql' : is not a class or namespace name	
Error	11	error C3861: 'get_mysql_driver_instance': identifier not found	
Error	12	error C2065: 'con' : undeclared identifier	
Error	13	error C2065: 'driver' : undeclared identifier	
Error	14	error C2227: left of '->connect' must point to class/struct/union/generictype	
Error	15	error C2065: 'con' : undeclared identifier	
Error	16	error C2541: 'delete' : cannot delete objects that are not pointers	
	17	IntelliSense: name followed by '::' must be a class or namespace name	
	18	IntelliSense: identifier "driver" is undefined	
	19	IntelliSense: name followed by '::' must be a class or namespace name	
	20	IntelliSense: identifier "con" is undefined	
	21	IntelliSense: name followed by '::' must be a class or namespace name



Is there any way to rectify these errors and make mysql connector compatible with vc++.
Posted
Comments
CPallini 13-Dec-13 15:47pm    
Did you include the driver/mysql_public_iface.h header in your source file?
compuknow 14-Dec-13 0:13am    
No. But where is it available and where should that file be?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900