View Full Version : Errore di compilazione Mysql , manca Termcap...
Linux&Xunil
09-05-2003, 11:31
.. il fatto è che il maledetto termcap lo ho installato e reinstallato ma il configure dei sorgenti di mysql continua a darmi questo errore:
cheking for termcap function library .... configure: error: No courses/termcap library found. :muro:
ilsensine
09-05-2003, 12:06
Installa i pacchetti -devel delle librerie ncurses e termcap.
Linux&Xunil
09-05-2003, 12:48
Originally posted by "ilsensine"
Installa i pacchetti -devel delle librerie ncurses e termcap.ho provato ad installare di tutto , non ne vuole sapere .. potrebbe essere un problema di permessi?
ilsensine
09-05-2003, 12:52
No.
Se guardi dentro configure.log (o config.log) c'è forse la motivazione esatta dell'errore, ma in genere questo capita quando mancano gli header delle librerie (ovvero il pacchetto -devel relativo).
Linux&Xunil
09-05-2003, 13:22
Era questo libncurses5-devel-5.3-1.20030215.1mdk.i586.rpm :p
Grazie , ciao!
Linux&Xunil
09-05-2003, 13:39
Oggi no ne vuole sapere , anche durante il make lo mena... :mad:
ilsensine
09-05-2003, 14:20
Originally posted by "Linux&Xunil"
libmysql.c: In function `mysql_real_connect':
libmysql.c:1731: too few arguments to function `gethostbyname_r'
Questo è un errore nel codice.
Puoi allegare il file "incriminato" (libmysql.c), che vedo se si può fare qualcosa?
Linux&Xunil
09-05-2003, 14:59
Come faccio a postare il sorgente?
Non mi allega ne i txt ne il .c ed è troppo lungo per essere postato .
Comunque i sorgenti li ho scaricati da mysql.com , strano che tirino delle borchie ( è una versione stabile).
Linux&Xunil
09-05-2003, 15:08
Ecchilo:
http://utenti.lycos.it/agev/libmysql.txt
ilsensine
09-05-2003, 15:25
mmm non facile. Hanno definito una macro chiamata my_gethostbyname_r, che a sua volta è mappata su gethostbyname_r. E' probabilmente questa ad avere il problema. Purtroppo questa macro non è definita nel file .c, ma in qualche file .h. Dovresti cercare (kfind ecc.) in quale file .h definiscono my_gethostbyname_r.
Linux&Xunil
09-05-2003, 15:48
ma non ti sembra strano che da mysql.com venga giu un errore del genere?
IO come unica nota a questi sorgenti ho trovato:
Compiler Advisory: Several users have reported random crashes and table corruptions when using MySQL binaries compiled with gcc 2.96 on the x86 Linux platform. We suggest that you use gcc 2.95 or gcc 2.91 to compile your own binaries. It should also be safe to use gcc 3.2.
Ed ho usato il gcc 3.2.2.....
Il problema sta nel codice del programma, sarebbe un gcc-bug alquanto strano.
In pratica ti dice che la funzione incriminata è chiamata con meno argomenti del necessario: la devi trovare nei sorgenti e postare almeno il prototipo
Linux&Xunil
09-05-2003, 16:06
Originally posted by "ilsensine"
mmm non facile. Hanno definito una macro chiamata my_gethostbyname_r, che a sua volta è mappata su gethostbyname_r. E' probabilmente questa ad avere il problema. Purtroppo questa macro non è definita nel file .c, ma in qualche file .h. Dovresti cercare (kfind ecc.) in quale file .h definiscono my_gethostbyname_r.
Eccolo ;)
http://utenti.lycos.it/agev/libmysql_r.txt
Linux&Xunil
09-05-2003, 16:08
Forse ho trovato l errore:
Questo
hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2),
diventa:
hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2)),
Giusto?
ilsensine
09-05-2003, 16:12
Originally posted by "Linux&Xunil"
Eccolo ;)
http://utenti.lycos.it/agev/libmysql_r.txt
No. Devi cercare tra i file .h.
No, non è giusto, dopo la virgola, a capo, c'è un altro parametro (è permesso in c)
Inoltre i 2 file che hai postato sono pressoché identici :confused:
Linux&Xunil
09-05-2003, 16:15
ok
Linux&Xunil
09-05-2003, 16:19
Niente , gli unici file nel cui testo è prsente quella funzione sono libmysql/libmysql.c;
libmysql/libmysql.c.
Allora dacci il link del pacco sorgente che guardiamo
Linux&Xunil
09-05-2003, 16:23
Trovato.... :o
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
thread safe version of some common functions:
my_inet_ntoa
This file is also used to make handling of sockets and ioctl()
portable accross systems.
*/
#ifndef _my_net_h
#define _my_net_h
C_MODE_START
#include <errno.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__NETWARE__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#if !defined(alpha_linux_port)
#include <netinet/tcp.h>
#endif
#endif
#if defined(__EMX__)
#include <sys/ioctl.h>
#define ioctlsocket(A,B,C) ioctl((A),(B),(void *)(C),sizeof(*(C)))
#undef HAVE_FCNTL
#endif /* defined(__EMX__) */
#if defined(MSDOS) || defined(__WIN__)
#define O_NONBLOCK 1 /* For emulation of fcntl() */
#endif
/* Thread safe or portable version of some functions */
void my_inet_ntoa(struct in_addr in, char *buf);
/*
Handling of gethostbyname_r()
*/
#if !defined(HPUX10)
struct hostent;
#endif /* HPUX */
#if !defined(HAVE_GETHOSTBYNAME_R)
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop);
void my_gethostbyname_r_free();
#elif defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop);
#define my_gethostbyname_r_free()
#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX10)
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
#endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT)
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop);
#define my_gethostbyname_r_free()
#else
#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
#define my_gethostbyname_r_free()
#endif /* !defined(HAVE_GETHOSTBYNAME_R) */
#ifndef GETHOSTBYNAME_BUFF_SIZE
#define GETHOSTBYNAME_BUFF_SIZE 2048
#endif
/* On SCO you get a link error when refering to h_errno */
#ifdef SCO
#undef h_errno
#define h_errno errno
#endif
C_MODE_END
#endif
ilsensine
09-05-2003, 16:36
Sospetto di questo:
#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT)
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop);
#define my_gethostbyname_r_free()
#else
#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
#define my_gethostbyname_r_free()
#endif /* !defined(HAVE_GETHOSTBYNAME_R) */
Forse è il configure che "sbaglia". Prova questo workaround: sostituisci la riga
#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
con queste righe:
static __inline struct hostent *my_gethostbyname_r(const char *A, struct hostent *B, char *C, size_t D, int *E) {
struct hostent *ret;
gethostbyname_r(A, B, C, D, &ret, E) ;
return ret;
}
ilsensine
09-05-2003, 16:40
Cmq se ha sbagliato il configure è un brutto segno, aspettati altri problemi...
Linux&Xunil
09-05-2003, 17:07
Originally posted by "lovaz"
Allora dacci il link del pacco sorgente che guardiamo
http://www.mysql.com/downloads/download.php?file=Downloads%2FMySQL-4.0%2Fmysql-4.0.12.tar.gz&mirror=http%3A%2F%2Fwww.teta.it%2Fmysql%2F
Linux&Xunil
09-05-2003, 18:33
Originally posted by "ilsensine"
Sospetto di questo:
#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT)
#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop);
#define my_gethostbyname_r_free()
#else
#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
#define my_gethostbyname_r_free()
#endif /* !defined(HAVE_GETHOSTBYNAME_R) */
Forse è il configure che "sbaglia". Prova questo workaround: sostituisci la riga
#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
con queste righe:
static __inline struct hostent *my_gethostbyname_r(const char *A, struct hostent *B, char *C, size_t D, int *E) {
struct hostent *ret;
gethostbyname_r(A, B, C, D, &ret, E) ;
return ret;
}
Funziona , sti cazzi compliementi :cool:
ilsensine
10-05-2003, 14:22
Source code rulez :cool:
Linux&Xunil
10-05-2003, 15:46
Originally posted by "ilsensine"
Source code rulez :cool:
Ri-complimenti :eek: :p :p :p :p :p
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.