MySQL problem

Tom Meinlschmidt tomas na meinlschmidt.org
Pondělí Březen 15 15:27:32 CET 2004


zkuste si pustit mysql_config --libs nebo --cflags, popr.  s --libmysqld-libs ...

takze Vase gcc bude

gcc `mysql_config --libs` `mysql_config --cflags` sql_auth.c -o sql_auth

zkuste to

TM

On Mon, 15 Mar 2004 15:09:13 +0100
Ing. Miloš Lesák <lesak na uvn.sk> wrote:

> Zdravim Vas.
> Chcel by som Vas poprosit o radu.
> 
> Zkompiloval som MySQL verziu mysql-4.0.18.tar.gz nasledovne:
> 
> ./configure
> --prefix=/usr/local/mysql
> --enable-assembler
> --with-mysqld-ldflags=-all-static
> --libdir=/usr/local/lib
> 
> Vsetko preslo v poriadku.
> Mam napisany programik v C na autentifikaciu uzivatelov squida
> ktory kompilujem nasledovnym sposobom:
> gcc -L/usr/local/lib/mysql -I/usr/local/mysql/include -lmysqlclient -o sql_auth sql_auth.c
> 
> Cast kodu
> ---------------------------
> #include <string.h>
> #include <stdio.h>
> #include <mysql/mysql.h>
> #include <time.h>
> 
> #define SERVER "localhost"
> #define SERVER_LOGIN ""
> #define SERVER_PASS ""
> 
> int check_time( char *accessString );
> int auth_ok( MYSQL *srvr, char *login, char *pass );
> 
> main()
> {
>  MYSQL auth_server, *retv=NULL;
>  char *login, *pass, buff[256];
> 
>  retv = mysql_connect( &auth_server, SERVER, SERVER_LOGIN, SERVER_PASS );
>  mysql_select_db( &auth_server, "uvnweb" );
>  setbuf( stdout, NULL );
> 
>  while( fgets( buff, sizeof(buff), stdin ) )
>   {
> -- 


Další informace o konferenci Linux