w3c libwww 컴파일 에러입니다.
글쓴이: sangheon / 작성시간: 월, 2003/12/22 - 4:03오후
가장 간단한 예제인데 컴파일 에러가 납니다.
[bookworm@blue libwwwexample]$ cat libapp_1.c #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <netinet/in.h> #include <w3c-libwww/WWWLib.h> #include <w3c-libwww/WWWHTTP.h> #include <w3c-libwww/WWWInit.h> #include <w3c-libwww/WWWHTML.h> int main() { HTLibInit("TestApp", "1.0"); HTLibTerminate(); return 0; } [bookworm@blue libwwwexample]$ make gcc -Wall -o libapp_1 libapp_1.c In file included from /usr/include/w3c-libwww/WWWLib.h:50, from libapp_1.c:6: /usr/include/w3c-libwww/wwwsys.h:1324: conflicting types for `sys_errlist' /usr/include/bits/sys_errlist.h:28: previous declaration of `sys_errlist' make: *** [libapp_1] 오류 1 [bookworm@blue libwwwexample]$
GCC 정보입니다.
[bookworm@blue libwwwexample]$ gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit Thread model: posix gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7) [bookworm@blue libwwwexample]$
Makefile 입니다.
[bookworm@blue libwwwexample]$ cat Makefile libapp_1: libapp_1.c gcc -Wall -o libapp_1 libapp_1.c [bookworm@blue libwwwexample]$
Forums:
[code:1]#define HAVE_STRERROR[/code:1]
#define HAVE_STRERROR
을 libwww 헤더 include하기 전에 적어주시면 될 겁니다. configure 스크립트가 있다면 거기서 HAVE_STRERROR을 정의할지 안 할지 결정하면 더 좋고요. sys_errlist가 선언되지 않은 경우를 대비해서 libwww가 직접 선언하는 부분이 wwwsys.h에 있는데, HAVE_STRERROR가 정의되지 않은 경우만 포함하도록 되어 있습니다.댓글 달기