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
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