Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Rceiving This Error on this code snippet.

VB
Error   1   error LNK2019: unresolved external symbol _mysql_real_connect@32 referenced in function _main
Error   2   error LNK2019: unresolved external symbol _mysql_init@4 referenced in function _main<pre lang="xml"><pre>#include "stdafx.h"

#include <iostream>
#include <conio.h>
#include <string>
#include <fstream>
#include <windows.h>
#include <C:\\Program Files\\MySQL\\MySQL Server 5.5\\include\\mysql.h>
using namespace std;
int main()
   {
   MYSQL* conn;
   conn = mysql_init(NULL);
   if(mysql_real_connect(conn,"urlock.db.5513143.hostedresource.com","VendorCheck","Reader1234","urlock",0,NULL,0) != 0)
         cout << "Connected!";
      else
         cout << "Failed!";
   return 0;
   }
Posted
Updated 7-May-11 16:40pm
v4

hello there
Sorry for the delay but following Artical may help you with the problem
http://mmf.utoronto.ca/resrchres/mysql/[^]
may be helpful
rest regards.
 
Share this answer
 
Comments
Member 7766180 8-May-11 10:18am    
This let the application open the console box, no more errors. Thank You!
IncredibleRam 8-May-11 10:24am    
pleasure is all mine but sorry for the delay this is not suppose to last this much long.
Santak Dalai 12-Mar-13 23:22pm    
can you repost the extra changes that you did to make the code working. It seems like the above link has expired.
hello there
never did this and dont know alot about this following link may be helpful for problem :

http://www.suite101.com/content/using-a-mysql-databases-with-c-a70097[^]

best regards.
 
Share this answer
 
Comments
Member 7766180 7-May-11 17:28pm    
Reading the article but still not connecting. Thank you.
Member 7766180 7-May-11 20:14pm    
Ok almost there. One problem. This is a console program, when the console opens I get this. "Can't start because libmysql.dll is not installed on tis computer".....It is installed and it's added to e Linker>Input...Additional Dependencies like this....
C:\\Program Files\\MySQL\\MySQL Server 5.5\\lib\\libmysql.lib
barneyman 7-May-11 22:02pm    
is the directory that libmysql.dll resides in, in your PATH?
Member 7766180 7-May-11 22:25pm    
Its in c:\\Program Files\\MySql\\MySql Server 5.5\\lib
barneyman 7-May-11 22:27pm    
is c:\Program Files\MySql\MySql Server 5.5\lib, in your PATH?

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