Link error in c++ builder 6.0
Posted by: jacemont jhon
Date: February 23, 2012 11:45PM

Hi,
I am troubling from a small program with mysql in borland c++ builder 6.0.
Source code as follow.

#include <winsock.h>
#include "mysql.h"
#include "Unit1.h"


#pragma hdrstop
#pragma package(smart_init)
#pragma resource "*.dfm"

MYSQL mysql;
int dum;

TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
mysql_init(NULL);
if (!(mysql_real_connect(&mysql,"localhost","root","root","mydatabase",0,NULL,0)))
{
ShowMessage("Connection failed.");
}
else
{
ShowMessage("Connection ");
}
mysql_close(&mysql);
}
//----


Link error :

[Linker Error] Unresolved external 'mysql_init' referenced from
[Linker Error] Unresolved external 'mysql_real_connect' referenced from
[Linker Error] Unresolved external 'mysql_close' referenced from

Help, thank you

Options: ReplyQuote


Subject
Views
Written By
Posted
Link error in c++ builder 6.0
2088
February 23, 2012 11:45PM


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.