slt tous le monde!!merci a tous ce que vous faites ici!!it's awesome!!
je suis en train de compiler avec gcc sur linux et j'ai ce probléme:
j'ai analysé le code mais il me parait que tout est normal:gcc -c -DLINUX -DUNIX_OPSYS -DDEBUG -I/home/oracle/Open2/COMMON/inc -I/home/oracle/Open2/dbg -I/home/oracle/Open2/syu/inc -I/home/oracle/Open2/syu/LGM/inc -I/usr/local/oracle/9.2.0/precomp/public -DLINUX -DUNIX_OPSYS -DDEBUG -I/home/oracle/Open2/COMMON/inc -I/home/oracle/Open2/dbg -I/home/oracle/Open2/syu/inc -I/home/oracle/Open2/syu/LGM/inc -I/usr/local/oracle/9.2.0/precomp/public -c -o su_lgm_lib_ctim.o su_lgm_lib_ctim.c
su_lgm_lib_ctim.c:39: erreur: conflicting types for ‘sys_errlist’
/usr/include/bits/sys_errlist.h:28: erreur: previous declaration of ‘sys_errlist’ was here
make: *** [su_lgm_lib_ctim.o] Erreur 1
j'ai essayé d'ouviri le fichier /usr/include/bits/sys_errlist.h:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66 /****************************************************************************/ /* Project: ePOST/Open2 */ /* File Name: su_lgm_lib_ctim.c */ /* Subsystem: System Utilities */ /* Module: LGM - Log Manager internal libraries */ /* Process: LGM */ /* Description: Log Manage common functions */ /* Author(s): R. Navone */ /* Created: 24-Set-1996 */ /****************************************************************************/ /* Modification History */ /* */ /* Revision Date Who modified Description */ /* ........ ..-...-.... ............. ............................... */ /****************************************************************************/ /****************************************************************************/ /* INCLUDEs and DEFINEs */ /****************************************************************************/ #include "su_lgm.h" #include "su_debug.h" /* What string. It must be defined in all source files */ static char lgmlib_c[]="@(#)$Workfile: su_lgm_lib_ctim.c $,$Revision: 2.0 $,$Modtime: 30 Jan 2003 15:36:32 $"; #ifdef FL_STATIC static char *SrC_NAmE = __FILE__; #define _FL SrC_NAmE,__LINE__ #else #define _FL __FILE__,__LINE__ #endif /****************************************************************************/ /* GLOBAL/EXTERNAL VARIABLES */ /****************************************************************************/ extern int errno, sys_nerr; extern char *sys_errlist[]; extern int Debug; /****************************************************************************/ /* FUNCTIONS DEFINITION */ /****************************************************************************/ /****************************************************************************/ /* Function: our_ctime */ /* L.M. Date: 24-Jun-1996 */ /* Description: Like the orginal ctime(), but the returned string doesn't */ /* contain new line (s). */ /****************************************************************************/ char *our_ctime(time_t t) { register char *p1, *p2; p1 = p2 = (char *)ctime(&t); while(*p1) { if (*p1 == '\n') { *p1 = 0; return(p2); } p1++; } return(p2); }
alors j'ai essayé d'inclure la lib stdio.h aussi bien que errno .h et ça a pas marché.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 /* Declare sys_errlist and sys_nerr, or don't. Compatibility (do) version. Copyright (C) 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _STDIO_H # error "Never include <bits/sys_errlist.h> directly; use <stdio.h> instead." #endif /* sys_errlist and sys_nerr are deprecated. Use strerror instead. */ #ifdef __USE_BSD extern int sys_nerr; extern __const char *__const sys_errlist[]; #endif #ifdef __USE_GNU extern int _sys_nerr; extern __const char *__const _sys_errlist[]; #endif
j'ai trouvé sur le net que c'est a cause que la fonction n'a pas de prototype déclaré déjà mais je crois pas que c'est ça le probléme.
merci de me donner des idées!!
Partager