dbTalk Databases Forums  

Using of MySQL++ : problem with --enable-auto-import

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Using of MySQL++ : problem with --enable-auto-import in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Using of MySQL++ : problem with --enable-auto-import - 05-29-2006 , 06:36 PM






Hi everyone,

I found in the archives a lot of problems about --enable-auto-import
where people found a solution, but this is not my case. I tried to user
the API MySQL in C, and MySQL++ in C++, but I always get this message, a
hundred times about :

variable 'iob' can't be auto-imported. Please read the ld's
documentation about --enable-auto-import.

I compile and run over Microsoft Windows XP Home Edition, with the IDE
Code::Blocks. Of course, I tried to compile the project with Dev-C++, I
get these messages in the linker message box (not in the compiler
errors, so I think this is a missing library) :

undefined reference to 'mysql_init'
undefined reference to 'mysql_real_connect'

.... and for each function of the API MySQL.

And look at the simple code I use :

#include <stdio.h>
#include <winsock.h>
#include <iostream.h>
#include "mysql/include/mysql.h"

int main(int argc, char *argv[])
{

MYSQL mysql;

mysql_init(&mysql);
mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"tes tMySQL");
if (!mysql_real_connect(&mysql,"localhost","root","", "lapage",0,NULL,0))
{
cout << "Connexion impossible!";
}
else
{
cout << "Connexion réussie!";
}

cout << "Bonjour!";
int y;
scanf("%ld", y);
return 0;
}

I use this code over Code::Blocks and Dev-C++, to get the errors I
described at first.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: Using of MySQL++ : problem with --enable-auto-import - 05-30-2006 , 08:34 AM






Alexbad, webmaster escribió:
Quote:
Hi everyone,

I found in the archives a lot of problems about --enable-auto-import
where people found a solution, but this is not my case. I tried to
user the API MySQL in C, and MySQL++ in C++, but I always get this
message, a hundred times about :

variable 'iob' can't be auto-imported. Please read the ld's
documentation about --enable-auto-import.

I compile and run over Microsoft Windows XP Home Edition, with the IDE
Code::Blocks. Of course, I tried to compile the project with Dev-C++,
I get these messages in the linker message box (not in the compiler
errors, so I think this is a missing library) :

undefined reference to 'mysql_init'
undefined reference to 'mysql_real_connect'

... and for each function of the API MySQL.

And look at the simple code I use :

#include <stdio.h
#include <winsock.h
#include <iostream.h
#include "mysql/include/mysql.h"

int main(int argc, char *argv[])
{

MYSQL mysql;

mysql_init(&mysql);
mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"tes tMySQL");
if
(!mysql_real_connect(&mysql,"localhost","root","", "lapage",0,NULL,0))
{
cout << "Connexion impossible!";
}
else
{
cout << "Connexion rᅵussie!";
}

cout << "Bonjour!";
int y;
scanf("%ld", y);
return 0;
}

I use this code over Code::Blocks and Dev-C++, to get the errors I
described at first.

Have you checked if your linker directories are including the mysql lib
dir or that mysql is included in the link libraries options, this may
fix undefined references.

But for that iob variable try adding --enable-runtime-pseudo-relloc flag
to the linker, it fixes most of those --enable-auto-import errors

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.