Problem with mysql.h in Vc++ 2010
Posted by: Adrian Radu
Date: May 20, 2011 05:21AM

Welcomed everyone can someone help me with this error?

My Code Is:

#include "bienvenida.h"
#include "thread.h"
#include <iostream>
#include <stdio.h>
#include <mysql.h>


#define host "server_name"
#define username "User_name"
#define password "my_pasword"
#define database "Db_name"


using namespace std;
//--//



//__//

private: System::Void panel2_MouseClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
mysql_connect();
}


int mysql_connect()
{

MYSQL *conn;
conn = mysql_init(NULL);
mysql_real_connect(conn,host,username,password,database,0,NULL,0);


return 0;
}



The setupt links is Ok.
Type Of App In Win Form App.

I would like if anyone has some examples, thanks.


//________ERROR___________--

1>------ OperaciĆ³n Generar iniciada: proyecto: My_APP, configuraciĆ³n: Debug Win32 ------
1> My_APP.cpp
1> My_APP.obj : error LNK2028: unresolved token (0A00001F) "extern "C" struct st_mysql * __stdcall mysql_init(struct st_mysql *)" (?mysql_init@@$$J14YGPAUst_mysql@@PAU1@@Z) referenced in function "private: int __clrcall My_APP::Form1::mysql_connect(void)" (?mysql_connect@Form1@My_APP@@$$FA$AAMHXZ)
1> My_APP.obj : error LNK2019: unresolved external symbol "extern "C" struct st_mysql * __stdcall mysql_init(struct st_mysql *)" (?mysql_init@@$$J14YGPAUst_mysql@@PAU1@@Z) referenced in function "private: int __clrcall My_APP::Form1::mysql_connect(void)" (?mysql_connect@Form1@ My_APP@@$$FA$AAMHXZ)
1>C:\Users\Work\documents\visual studio 2010\Projects\ My_APP\Debug\ My_APP.exe : fatal error LNK1120: 2 unresolved externals
========== Generar: 0 correctos, 1 incorrectos, 0 actualizados, 0 omitidos ==========

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem with mysql.h in Vc++ 2010
1067
May 20, 2011 05:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.