[완료] qpopper4.0.9 make 에러

viiiin의 이미지

안녕하세요.

메일 서버 테스트를 위해서 qpopper를 설치하던 중 make 에러가 발생했는데요.
열심히 구글링을 해 봐도 해답을 찾지 못해서 이렇게 질문까지 하게 되었습니다.

우선, 제가 참고한 사이트는 http://www.linuxfromscratch.org/blfs/view/svn/server/qpopper.html 입니다.

여기서 Qpopper-4.0.9 소스 컴파일 튜토리얼을 열심히 따라하는데 make 에러가 발생했구요.
configure 옵션과 에러 내용은 다음과 같습니다.

(*참고로 os는 fedora14 입니다.)

-----------------------------------------------------------------------------------------------
[root@mail qpopper4.0.9]# ./configure --prefix=/usr --enable-standalone && make

...(생략)...

configure: creating ./config.status
config.status: creating Makefile
config.status: creating common/Makefile
config.status: creating popper/Makefile
config.status: creating mmangle/Makefile
config.status: creating password/Makefile
config.status: creating config.h
config.status: config.h is unchanged
cd ./popper && make all
make[1]: Entering directory `/usr/local/src/qpopper4.0.9/popper'
gcc -c -I.. -I.. -I. \
-I../mmangle -I../common \
-g -O2 -DHAVE_CONFIG_H -DLINUX -DUNIX popper.c -o popper.o
popper.c: In function ‘qpopper’:
popper.c:153:25: error: conflicting types for ‘getline’
/usr/include/stdio.h:673:20: note: previous declaration of ‘getline’ was here
popper.c: In function ‘tgetline’:
popper.c:617:9: warning: passing argument 1 of ‘getline’ from incompatible pointer type
/usr/include/stdio.h:673:20: note: expected ‘char ** __restrict__’ but argument is of type ‘char *’
popper.c:617:9: warning: passing argument 2 of ‘getline’ makes pointer from integer without a cast
/usr/include/stdio.h:673:20: note: expected ‘size_t * __restrict__’ but argument is of type ‘int’
popper.c:617:9: warning: passing argument 3 of ‘getline’ from incompatible pointer type
/usr/include/stdio.h:673:20: note: expected ‘struct FILE * __restrict__’ but argument is of type ‘struct POP *’
popper.c:617:13: warning: assignment makes pointer from integer without a cast
make[1]: *** [popper.o] Error 1
make[1]: Leaving directory `/usr/local/src/qpopper4.0.9/popper'
make: *** [popper_server] Error 2
[root@mail qpopper4.0.9]#
-----------------------------------------------------------------------------------------------
저와 같은 에러가 발생했던 사람의 글을 확인했는데요.
솔라리스에서 발생한 에러이긴 하지만 같은 에러라서 참고해 봤습니다.

http://support.moonpoint.com/network/email/qpopper/qpopper4-0-16.php

어떻게 해결했는지 그 내용을 잘 모르겠습니다.

hys545의 이미지

getline을 stdio.h에 있는거 참고해서
소스를 고쳐야 할거 같은데여

즐린

viiiin의 이미지

감사합니다. ^^

sandy의 이미지

오래된 qpopper 버젼을 사용하시네요.
물론 인터넷에 있는 강좌가 특정 버젼을 기초로 쓰여진 까닭이겠죠.

쉬운 해결책은 최신 버젼을 사용하시는 겁니다.

http://ftp.yz.yamagata-u.ac.jp/pub/network/qpopper/qpopper4.0.19.tar.gz

http://ftp.ticklers.org/pub/qpopper/beta/qpopper4.1b18.tar.gz

꼭 qpopper4.0.9.tar.gz 버젼을 써야겠다 하시면
표준 c 라이브러리 getline과 혼동되지 않게 다른 이름으로 바꾸어 주셔야 합니다.

--- qpopper4.0.9-old/popper/popper.c 
+++ qpopper4.0.9/popper/popper.c 
@@ -150,7 +150,7 @@
     char                message [ MAXLINELEN ];
     pop_result          rslt = POP_FAILURE;
     char            *   tgetline();
-    char            *   getline();
+    char            *   Qgetline();
 
     /*
      * seed random with the current time to nearest second 
@@ -425,7 +425,7 @@
  */
 
 char
-*getline ( char *str, int size, POP *pPOP )
+*Qgetline ( char *str, int size, POP *pPOP )
 {
     char *p       = NULL;
     int   nRead   = 0;
@@ -433,7 +433,7 @@
     int   nBufSz  = sizeof ( pPOP->pcInBuf );
 
 
-    _DEBUG_LOG2 ( pPOP, "getline(%p,%d)", str, size );
+    _DEBUG_LOG2 ( pPOP, "Qgetline(%p,%d)", str, size );
 
     /*
      * See if there's a line in our input buffer
@@ -472,7 +472,7 @@
                               pPOP->pcInStart - pPOP->pcInBuf );
                 pPOP->pcInStart = pPOP->pcInEnd = pPOP->pcInBuf;
             }
-            _DEBUG_LOG3 ( pPOP, "getline() returning %d: '%.*s'",
+            _DEBUG_LOG3 ( pPOP, "Qgetline() returning %d: '%.*s'",
                           strlen(str), MIN(25, (int) strlen(str)), str );
             return ( str );
         } /* got a line */
@@ -560,7 +560,7 @@
                 } /* found a '\n' */
             } /* loop and discard until we see a '\n' */
 
-            _DEBUG_LOG2 ( pPOP, "getline() returning %d ('%c')",
+            _DEBUG_LOG2 ( pPOP, "Qgetline() returning %d ('%c')",
                           strlen(str), *str );
             return ( str );
         } /* nRoom == 0 */
@@ -583,7 +583,7 @@
             break;
     } /* main loop */
 
-    _DEBUG_LOG0 ( pPOP, "getline() returning NULL" );
+    _DEBUG_LOG0 ( pPOP, "Qgetline() returning NULL" );
     return ( NULL );
 }
 
@@ -614,7 +614,7 @@
                   VERSION, timeout, p->user, p->client, p->ipaddr );
     }
     else
-        str = getline ( str, size, p );
+        str = Qgetline ( str, size, p );
 
     alarm  ( 0 );
     signal ( SIGALRM, SIG_DFL );

실제로 최신버젼들은 바로 위 패치가 이미 적용되어 있습니다.
위 코드를 편집기로 저장하시거나 아래 첨부파일을 받으셔서 패치하시면 됩니다.

$ cp qpopper-getline.patch qpopper4.0.9
$ cd qpopper4.0.9
[qpopper4.0.9]$ patch -p0 < qpopper-getline.patch
patching file qpopper4.0.9/popper/popper.c

댓글 첨부 파일: 
첨부파일 크기
파일 qpopper-getline.patch1.98 KB

..

viiiin의 이미지

그런 문제가 있었군요...
이런 오류가 없었으면 모르고 그냥 지나칠뻔 했는데 잘 알려주셔서 감사합니다.
바로 테스트 해보죠~

좋은 하루 되세요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.