MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:hgz Date:March 26 1999 6:13am
Subject:Re: ESQL-C and UNIONs
View as plain text  
Thimble Smith:
        Thank you very much giveing me much information!
but still can't compile my source code:test.c
#include <stdio.h>
#include <stdlib.h>
#include "mysql.h"
#include "chardefs.h"
#include "dbug.h"
#include "errmsg.h"
#include "history.h"
#include "keymaps.h"
#include ""
#include "m_string.h"
#include "my_sys.h"
#include "mysql_com.h"
#include "mysql_version.h"
#include "readline.h"
#include "tilde.h"
int main( int ac, char** av )
          MYSQL *sock,mysql;
          printf("Only a test!");
          if (!(sock = mysql_connect(&mysql,NULL,0,0)))
           fprintf(stderr,"Couldn't connect to engine!\n%s\n\n",mysql_error(&mysql));

     if (mysql_select_db(sock,"test") < 0)
        fprintf(stderr,"Couldn't select database %s!\n%s\n","test",

use your command:
gcc -g -I/usr/local/include/mysql test.c -L/usr/local/lib/mysql -lmysqlclient -o test
much error occurs,exam:
/usr/local/include/mysql/my_sys.h:414:parse error before 'size_s'
/usr/local/include/mysql/my_sys.h:415:parse error before '*'
/usr/local/include/mysql/my_sys.h:417:parse error before 'size_s'
I am anxious for your help!
Thanks all

Thimble Smith wrote:

> Hi.  Just so you know, the address for the mailing list is
> mysql@stripped.  Your message only made it to one
> person (me).
> If you're using Linux, you shouldn't need -lsocket or -lnsl,
> I don't think.  Those libraries are used on Solaris (and probably
> some other OSs).
> The simplest is probably:
> gcc -g -I/usr/local/include/mysql test.c -L/usr/local/lib/mysql -lmysqlclient -o
> test
> Tim
> On Fri, Mar 26, 1999 at 11:43:51AM +0800, hgz wrote:
> > hello:
> >       I  want to use MYSQL and C to write some programs ,I use like this:
> >       gcc -c test.c
> >       gcc -g -o test test.o -L/usr/local/lib/mysql -lmysqlclient -lsocket
> > -lnsl
> > the error is:
> >      ld:can't open -lsocket:No such file or directoy
> > My OS is Red Hat linux 5.2
> > I really don't know how to do it?
> > Thanks in advance!
> >
> >
> >

ESQL-C and UNIONsFred Butzen25 Mar
  • Re: ESQL-C and UNIONsThimble Smith25 Mar
  • Re: ESQL-C and UNIONshgz26 Mar
    • Re: ESQL-C and UNIONsMichael Widenius26 Mar