![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |