1 message in com.mysql.lists.pluspluserror while linking lib func mysqlcli...| From | Sent On | Attachments |
|---|---|---|
| shah jimi | 16 Sep 2001 21:32 |
| Subject: | error while linking lib func mysqlclient, can you help![]() |
|---|---|
| From: | shah jimi (jimi...@yahoo.com) |
| Date: | 09/16/2001 09:32:10 PM |
| List: | com.mysql.lists.plusplus |
Dear friends, My name is Jimi. I am working on a project that involves to store my data through c++ in mysql.
when i tried to run my program that just tries to connect to mysql server, following error arrived :
/usr/lib/mysql/libmysqlclient.so : undefined reference to 'mkstemp64@GLIBC_2.2' collect2 : ld returned 1 exit status
Here is the program
#include<stdlib.h> #include<stdio.h> #include "/usr/include/mysql/mysql.h" #include<string.h>
#define def_host_name NULL #define def_user_name NULL #define def_password NULL #define def_db_name "db"
MYSQL *conn ; char query[500] ; MYSQL_RES *res_set ; char fields[7][50] ;
int main(void) { conn = mysql_init(NULL) ;
if(mysql_real_connect(conn, def_host_name, def_user_name, def_password, def_db_name, 0, NULL, 0)==NULL) { fprintf(stderr,"error 1.: can't connect to mysql server") ; exit(0) ; } printf("successfully connected to server\n") ; return(0) ; }
even if i try to run following program as doing nothing, but just prints a message(i.e. i don't try to use any of mysql API in it), but the error comes when i try to link to the library function by giving following command on prompt :
$g++ mysql.cpp -L/usr/lib/mysql -lmysqlclient
I have installed mysql from following rpm packages :
mysql-3.23.36-1.i386.rpm mysql-devel-3.23.36-1.i386.rpm mysql-server-3.23.36-1.i386.rpm mysqlclient9-3.23.22-4.i386.rpm
MY O.s. is redhat linux 7.0
PLEAE HELP ME IF YOU KNOW ANY THING THAT CAN SOLVE ABOVE PROBLEM............. regards jimi shah
__________________________________________________ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/




