MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:April Escamilla Date:June 9 1999 3:07pm
Subject:Re: mysql_real_connect problem??
View as plain text  
Paul,

    Thanks very much for your quick responses and suggestions.  I went ahead
and tried the combination you suggested -- I deleted the db argument, and
tried to compile by specifying -lmysqlclient instead of -lmysql.  Here's
what I got back

#  cc -o mysql_connect mysql_connect.c -lc -lmysqlclient
undefined                       first referenced
 symbol                             in file
mysql_init                          mysql_connect.o
mysql_real_connect                  mysql_connect.o
i386ld fatal: Symbol referencing errors. No output written to mysql_connect


#cc -o mysql_connect mysqlconnect.c -lc -L/u/april/mysql -lmysqlclient
<
undefined                       first referenced
 symbol                             in file
mysql_init                          mysql_connect.o
mysql_real_connect                  mysql_connect.o
i386ld fatal: Symbol referencing errors. No output written to mysql_connect


  Any thoughts on this, Paul, or anyone else?

-----Original Message-----
From: Paul DuBois <paul@stripped>
To: April Escamilla <aprile@stripped>; Paul DuBois
<paul@stripped>
Cc: mysql@stripped <mysql@stripped>
Date: Wednesday, June 09, 1999 10:01 AM
Subject: Re: mysql_real_connect problem??


>At 9:52 AM -0500 6/9/99, April Escamilla wrote:
>>Paul,
>>
>>   Here's a cut from the c code I am using:
>>
>>    10  int main()
>>    11  {
>>    12    MYSQL mysql;
>>    13
>>    14    mysql_init(&mysql);
>>    15    if
>>(!mysql_real_connect(&mysql,"host","user","passwd","db",0,NULL,0))
>>    16    {
>>    17      fprintf(stderr, "Failed to connect to database: Error:
>>%s\n",mysql_e
>>rror(&mysql));
>>    18    }
>>    19    else
>>    20     {
>>    21      printf("Connected to database. \n");
>>    22     }
>>    23  }  //end of main function
>>
>>
>>   Of course, host, user, etc have actual values in the code like ip
address
>>etc.  I did try to remove arguments from the call and got the following
>>error:
>>
>>>>>"mysql_connect.c", line 11: warning: improper pointer/integer
>>combination:
>>>arg #5
>>>>>i386ld libc.a:  can't find library libmysql.a
>>
>>  Do you think this is a function problem or is a library missing?
>>  If I forgot to include any information at all, please let me know -- I
can
>>happily provide it for you.
>
>From your earlier description of the problem, it sounds like you should
>remove the db argument.  You can check this by looking in mysql.h to see
>what the prototype for mysql_real_connect() looks like it.
>
>The link problem (can't find libmysql.a) looks odd to my.  Normally the
>library you want to link in is libmysqlclient.a.  Are you specifying
>-lmysql on the command?  Try -lmysqlclient instead.  You'll probably
>need -L/usr/local/lib/mysql -lmysqlclient (where the path after the -L
>indicates the directory your mysql libraries are located - I know
>you said you couldn't find libmysql.a, but that's probably because
>there isn't one.  At least, I don't have one.)
>
>--
>Paul DuBois, paul@stripped
>Northern League Chronicles: http://www.snake.net/nl/
>
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail mysql-thread4877@stripped
>
>To unsubscribe, send a message to the address shown in the
>List-Unsubscribe header of this message. If you cannot see it,
>e-mail mysql-unsubscribe@stripped instead.
>
>

Thread
mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
  • Re: mysql_real_connect problem??Michael Widenius9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Sasha Pachev9 Jun
Re: mysql_real_connect problem??April Escamilla9 Jun
  • Re: mysql_real_connect problem??Paul DuBois10 Jun
  • Re: mysql_real_connect problem??Sasha Pachev10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
  • Re: mysql_real_connect problem??Sasha Pachev10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
  • Re: mysql_real_connect problem??Sasha Pachev10 Jun
Re: mysql_real_connect problem??April Escamilla10 Jun
  • Re: mysql_real_connect problem??Paul DuBois10 Jun
  • Re: mysql_real_connect problem??Sasha Pachev10 Jun
Re: mysql_real_connect problem??April Escamilla11 Jun
  • Re: mysql_real_connect problem??Sasha Pachev11 Jun