MySQL Forums
Forum List  »  Perl

MySQL C API
Posted by: Aswathi R
Date: September 05, 2011 11:22PM

I wrote a C program that connects to MySQL on Wamp. I am using lcc C compiler (on XP).

myfile.c

#include <mysql.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
printf("MySQL client version: %s\n", mysql_get_client_info());
}

I compiled using

C:\lcc\bin>lc myfile.c -o myfile
myfile.obj .text: undefined reference to '_mysql_get_client_info@0'
linker returned 1

so i tried

C:\lcc\bin>lc myfile.c -o myfile 'mysql_config --cflags --libs'
unrecognized option --cflags. Ignored
unrecognized option --libs'. Ignored
cannot open 'mysql_config
linker returned 1

what is wrong?

Options: ReplyQuote


Subject
Written By
Posted
MySQL C API
September 05, 2011 11:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.