Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mysql C++ Connectivity

Status
Not open for further replies.

Kadu

Programmer
May 4, 2004
1
IN
I am facing problem in compiling c++ program using mysql libraries. I am doing this for the first time. I would appreciate if anyone of you help me out.

thanks.


folowing is the code
___________________________________
#include <mysql.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
MYSQL mysql;
assert(mysql_init(&mysql) != NULL);
}

following is the command i am using to compling
________________________________________________________________
#gcc connect.c -o mysql_capi.cgi -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lm


following is the output i am getting
________________________________________________________________

/usr/lib/mysql/libmysqlclient.a(my_compress.o): In function `my_uncompress':
my_compress.o(.text+0xaa): undefined reference to `uncompress'
/usr/lib/mysql/libmysqlclient.a(my_compress.o): In function `my_compress_alloc':
my_compress.o(.text+0x13c): undefined reference to `compress'
collect2: ld returned 1 exit status
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top