Loading ...
Sorry, an error occurred while loading the content.

Postfix with MYSQL compile error

Expand Messages
  • Lydiard
    Hi I m having a devil of a job trying to reinstall Postfix (my server s disk crashed and I have to reinstall it all from scratch). Current server is debian
    Message 1 of 4 , Nov 29, 2007
    • 0 Attachment
      Hi

      I'm having a devil of a job trying to reinstall Postfix (my server's
      disk crashed and I have to reinstall it all from scratch).

      Current server is debian (with which I'm not totally familiar - but
      since my FC.x knowledge was also limited shouldn't be seen as too much
      of a hinderence).

      I've googled and googled and found nothing - so I figure if nothing
      else it may help others.

      I've installed Openssl (tried to do it from source but eventually did
      it with apt-get because Apache was complaining).

      I installed mysql using apt-get

      I've installed Apache (with openssl and mysql and php options)
      successfully from source.

      I've restored my mysql databases (including the mail ones) successfully.

      When compiling postfix (hopefully with SASL, LDAP, MySQL, and all the
      bells and whistles that will come later (i.e. courier, spam-assassin,
      amvisd, etc...) I am using this on the command line:

      make -f Makefile.init makefiles 'CCARGS="-DHAS_MYSQL
      -I/usr/include/mysql" "-DUSE_TLS -I/usr/local/include" "-DHAS_PCRE
      -I/usr/include" "-I/usr/local/include -DHAS_LDAP" "-DHAS_DB
      -I/usr/local/BerkeleyDB.4.6/include" "-DUSE_SASL_AUTH -DUSE_CYRUS_SASL
      -I/usr/local/include/sasl"' 'AUXLIBS="-L/usr/local/lib -lssl -lcrypto"
      "-L/usr/lib -lpcre" "-L/usr/local/lib -lldap -L/usr/local/lib -llber"
      "-L/usr/local/lib -lsasl2" "-L/usr/local/BerkeleyDB.4.6/lib -ldb"
      "-L/usr/lib -lmysqlclient -lz -lm"'


      No errors are given.

      make halts with this:

      dict_mysql.c: At top level:
      dict_mysql.c:490: error: expected "=", ",", ";", "asm" or
      "__attribute__" before "*" token
      dict_mysql.c: In function "plmysql_connect_single":
      dict_mysql.c:542: error: "HOST" has no member named "db"
      dict_mysql.c:544: error: "HOST" has no member named "db"
      dict_mysql.c:545: error: "HOST" has no member named "type"
      dict_mysql.c:545: error: "HOST" has no member named "name"
      dict_mysql.c:549: error: "HOST" has no member named "port"
      dict_mysql.c:550: error: "HOST" has no member named "type"
      dict_mysql.c:550: error: "HOST" has no member named "name"
      dict_mysql.c:554: error: "HOST" has no member named "hostname"
      dict_mysql.c:555: error: "HOST" has no member named "stat"
      dict_mysql.c:558: error: "HOST" has no member named "hostname"
      dict_mysql.c:558: error: "HOST" has no member named "db"
      dict_mysql.c: In function "plmysql_close_host":
      dict_mysql.c:566: error: "HOST" has no member named "db"
      dict_mysql.c:567: error: "HOST" has no member named "db"
      dict_mysql.c:568: error: "HOST" has no member named "stat"
      dict_mysql.c: In function "plmysql_down_host":
      dict_mysql.c:577: error: "HOST" has no member named "db"
      dict_mysql.c:578: error: "HOST" has no member named "db"
      dict_mysql.c:579: error: "HOST" has no member named "ts"
      dict_mysql.c:580: error: "HOST" has no member named "stat"
      dict_mysql.c: In function "host_init":
      dict_mysql.c:707: error: "HOST" has no member named "db"
      dict_mysql.c:708: error: "HOST" has no member named "hostname"
      dict_mysql.c:709: error: "HOST" has no member named "port"
      dict_mysql.c:710: error: "HOST" has no member named "stat"
      dict_mysql.c:711: error: "HOST" has no member named "ts"
      dict_mysql.c:719: error: "HOST" has no member named "type"
      dict_mysql.c:723: error: "HOST" has no member named "type"
      dict_mysql.c:725: error: "HOST" has no member named "name"
      dict_mysql.c:726: error: "HOST" has no member named "name"
      dict_mysql.c:727: error: "HOST" has no member named "port"
      dict_mysql.c:728: error: "HOST" has no member named "name"
      dict_mysql.c:730: error: "HOST" has no member named "name"
      dict_mysql.c:731: error: "HOST" has no member named "name"
      dict_mysql.c:732: error: "HOST" has no member named "type"
      dict_mysql.c:737: error: "HOST" has no member named "name"
      dict_mysql.c:737: error: "HOST" has no member named "name"
      dict_mysql.c:738: error: "HOST" has no member named "port"
      dict_mysql.c:738: error: "HOST" has no member named "type"
      dict_mysql.c: In function "plmysql_dealloc":
      dict_mysql.c:772: error: "HOST" has no member named "db"
      dict_mysql.c:773: error: "HOST" has no member named "db"
      dict_mysql.c:774: error: "HOST" has no member named "hostname"
      dict_mysql.c:775: error: "HOST" has no member named "name"
      dict_mysql.c:776: error: "HOST" has no member named "name"
      make: *** [dict_mysql.o] Error 1
      make: *** [update] Error 1

      at which point, I found that the only copy of dict_mysql.o on my
      system was in the backed-up directory I did a few weeks before the
      server crashed - i.e. in the old ..src/postfix-2.1.5/src/global/
      directory.

      When I copied that (please tell me that was Ok!?) into the current
      src/global make was much happier but is now halting at:

      ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_compile':
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:554: undefined
      reference to `pcre_compile'
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:561: undefined
      reference to `pcre_study'
      ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_open':
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:817: undefined
      reference to `pcre_malloc'
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:818: undefined
      reference to `pcre_free'
      ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_parse_rule':
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:668: undefined
      reference to `pcre_fullinfo'
      ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_lookup':
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:288: undefined
      reference to `pcre_exec'
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:339: undefined
      reference to `pcre_exec'
      ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_expand':
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:177: undefined
      reference to `pcre_get_substring'
      collect2: ld returned 1 exit status
      make: *** [sendmail] Error 1
      make: *** [update] Error 1

      but this time, the file does exist! :(

      donald:# slocate dict_pcre.c
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c


      Google showed this:
      http://archives.neohapsis.com/archives/postfix/2004-10/thread.html#94

      Which points to http://www.postfix.org/DB_README.html and says I
      should install from source although dpkg -l already says I have the
      library.. and also that it seems to be the file in the
      postfix-2.4.6/src directory that seems to be missing, NOT a berkley
      file.

      So, then I got clever and actually read the PCRE_README and installed
      that from source too (which worked flawlessly), but I'm still stopping
      at the same point even though the . I.e.

      ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_expand':
      /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:177: undefined
      reference to `pcre_get_substring'
      collect2: ld returned 1 exit status
      make: *** [sendmail] Error 1
      make: *** [update] Error 1

      so then I looked for dict.pcre.o - not there (in
      postfix-2.4.6/src/util where it should be according to the old file
      sturcture I had. So I copied that over too (and I'm really not sure
      that's a good idea).

      Now, I'm failing at:

      ../../lib/libutil.a(dict_open.o):(.data+0x2c): undefined reference to
      `dict_pcre_open'
      collect2: ld returned 1 exit status
      make: *** [sendmail] Error 1
      make: *** [update] Error 1

      Again, dict_open.o doesn't exist (except in my old back-edup server
      structure). So, now I've removed the directory and rerun

      tar - zxvf postfix-2.4.6.tar.gz

      but the file is still not there. There no dict_*.o in the current
      /usr/local/src/postfix-2.4.6/src/ directly. So this (and no stupidly
      linked files as I first thought) would seem to be the issue.

      Am I okay to continue copying them over? Should I be doing something else?

      Thanks.

      Lydiard
    • Lydiard
      In order not to top post please see the comment/update at the bottom... ... Date: Thu, 29 Nov 2007 20:11:56 +0100 From: Lydiard Reply-To:
      Message 2 of 4 , Nov 29, 2007
      • 0 Attachment
        In order not to top post please see the comment/update at the bottom...

        ----- Message from lydiard@... ---------
        Date: Thu, 29 Nov 2007 20:11:56 +0100
        From: Lydiard <lydiard@...>
        Reply-To: Lydiard <lydiard@...>
        Subject: Postfix with MYSQL compile error
        To: postfix-users@...


        > Hi
        >
        > I'm having a devil of a job trying to reinstall Postfix (my server's
        > disk crashed and I have to reinstall it all from scratch).
        >
        > Current server is debian (with which I'm not totally familiar - but
        > since my FC.x knowledge was also limited shouldn't be seen as too much
        > of a hinderence).
        >
        > I've googled and googled and found nothing - so I figure if nothing
        > else it may help others.
        >
        > I've installed Openssl (tried to do it from source but eventually did
        > it with apt-get because Apache was complaining).
        >
        > I installed mysql using apt-get
        >
        > I've installed Apache (with openssl and mysql and php options)
        > successfully from source.
        >
        > I've restored my mysql databases (including the mail ones) successfully.
        >
        > When compiling postfix (hopefully with SASL, LDAP, MySQL, and all the
        > bells and whistles that will come later (i.e. courier, spam-assassin,
        > amvisd, etc...) I am using this on the command line:
        >
        > make -f Makefile.init makefiles 'CCARGS="-DHAS_MYSQL
        > -I/usr/include/mysql" "-DUSE_TLS -I/usr/local/include" "-DHAS_PCRE
        > -I/usr/include" "-I/usr/local/include -DHAS_LDAP" "-DHAS_DB
        > -I/usr/local/BerkeleyDB.4.6/include" "-DUSE_SASL_AUTH -DUSE_CYRUS_SASL
        > -I/usr/local/include/sasl"' 'AUXLIBS="-L/usr/local/lib -lssl -lcrypto"
        > "-L/usr/lib -lpcre" "-L/usr/local/lib -lldap -L/usr/local/lib -llber"
        > "-L/usr/local/lib -lsasl2" "-L/usr/local/BerkeleyDB.4.6/lib -ldb"
        > "-L/usr/lib -lmysqlclient -lz -lm"'
        >
        >
        > No errors are given.
        >
        > make halts with this:
        >
        > dict_mysql.c: At top level:
        > dict_mysql.c:490: error: expected "=", ",", ";", "asm" or
        > "__attribute__" before "*" token
        > dict_mysql.c: In function "plmysql_connect_single":
        > dict_mysql.c:542: error: "HOST" has no member named "db"
        > dict_mysql.c:544: error: "HOST" has no member named "db"
        > dict_mysql.c:545: error: "HOST" has no member named "type"
        > dict_mysql.c:545: error: "HOST" has no member named "name"
        > dict_mysql.c:549: error: "HOST" has no member named "port"
        > dict_mysql.c:550: error: "HOST" has no member named "type"
        > dict_mysql.c:550: error: "HOST" has no member named "name"
        > dict_mysql.c:554: error: "HOST" has no member named "hostname"
        > dict_mysql.c:555: error: "HOST" has no member named "stat"
        > dict_mysql.c:558: error: "HOST" has no member named "hostname"
        > dict_mysql.c:558: error: "HOST" has no member named "db"
        > dict_mysql.c: In function "plmysql_close_host":
        > dict_mysql.c:566: error: "HOST" has no member named "db"
        > dict_mysql.c:567: error: "HOST" has no member named "db"
        > dict_mysql.c:568: error: "HOST" has no member named "stat"
        > dict_mysql.c: In function "plmysql_down_host":
        > dict_mysql.c:577: error: "HOST" has no member named "db"
        > dict_mysql.c:578: error: "HOST" has no member named "db"
        > dict_mysql.c:579: error: "HOST" has no member named "ts"
        > dict_mysql.c:580: error: "HOST" has no member named "stat"
        > dict_mysql.c: In function "host_init":
        > dict_mysql.c:707: error: "HOST" has no member named "db"
        > dict_mysql.c:708: error: "HOST" has no member named "hostname"
        > dict_mysql.c:709: error: "HOST" has no member named "port"
        > dict_mysql.c:710: error: "HOST" has no member named "stat"
        > dict_mysql.c:711: error: "HOST" has no member named "ts"
        > dict_mysql.c:719: error: "HOST" has no member named "type"
        > dict_mysql.c:723: error: "HOST" has no member named "type"
        > dict_mysql.c:725: error: "HOST" has no member named "name"
        > dict_mysql.c:726: error: "HOST" has no member named "name"
        > dict_mysql.c:727: error: "HOST" has no member named "port"
        > dict_mysql.c:728: error: "HOST" has no member named "name"
        > dict_mysql.c:730: error: "HOST" has no member named "name"
        > dict_mysql.c:731: error: "HOST" has no member named "name"
        > dict_mysql.c:732: error: "HOST" has no member named "type"
        > dict_mysql.c:737: error: "HOST" has no member named "name"
        > dict_mysql.c:737: error: "HOST" has no member named "name"
        > dict_mysql.c:738: error: "HOST" has no member named "port"
        > dict_mysql.c:738: error: "HOST" has no member named "type"
        > dict_mysql.c: In function "plmysql_dealloc":
        > dict_mysql.c:772: error: "HOST" has no member named "db"
        > dict_mysql.c:773: error: "HOST" has no member named "db"
        > dict_mysql.c:774: error: "HOST" has no member named "hostname"
        > dict_mysql.c:775: error: "HOST" has no member named "name"
        > dict_mysql.c:776: error: "HOST" has no member named "name"
        > make: *** [dict_mysql.o] Error 1
        > make: *** [update] Error 1
        >
        > at which point, I found that the only copy of dict_mysql.o on my system
        > was in the backed-up directory I did a few weeks before the server
        > crashed - i.e. in the old ..src/postfix-2.1.5/src/global/ directory.
        >
        > When I copied that (please tell me that was Ok!?) into the current
        > src/global make was much happier but is now halting at:
        >
        > ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_compile':
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:554: undefined
        > reference to `pcre_compile'
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:561: undefined
        > reference to `pcre_study'
        > ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_open':
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:817: undefined
        > reference to `pcre_malloc'
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:818: undefined
        > reference to `pcre_free'
        > ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_parse_rule':
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:668: undefined
        > reference to `pcre_fullinfo'
        > ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_lookup':
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:288: undefined
        > reference to `pcre_exec'
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:339: undefined
        > reference to `pcre_exec'
        > ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_expand':
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:177: undefined
        > reference to `pcre_get_substring'
        > collect2: ld returned 1 exit status
        > make: *** [sendmail] Error 1
        > make: *** [update] Error 1
        >
        > but this time, the file does exist! :(
        >
        > donald:# slocate dict_pcre.c
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c
        >
        >
        > Google showed this:
        > http://archives.neohapsis.com/archives/postfix/2004-10/thread.html#94
        >
        > Which points to http://www.postfix.org/DB_README.html and says I should
        > install from source although dpkg -l already says I have the library..
        > and also that it seems to be the file in the postfix-2.4.6/src
        > directory that seems to be missing, NOT a berkley file.
        >
        > So, then I got clever and actually read the PCRE_README and installed
        > that from source too (which worked flawlessly), but I'm still stopping
        > at the same point even though the . I.e.
        >
        > ../../lib/libutil.a(dict_pcre.o): In function `dict_pcre_expand':
        > /usr/local/src/postfix-2.4.6/src/util/dict_pcre.c:177: undefined
        > reference to `pcre_get_substring'
        > collect2: ld returned 1 exit status
        > make: *** [sendmail] Error 1
        > make: *** [update] Error 1
        >
        > so then I looked for dict.pcre.o - not there (in postfix-2.4.6/src/util
        > where it should be according to the old file sturcture I had. So I
        > copied that over too (and I'm really not sure that's a good idea).
        >
        > Now, I'm failing at:
        >
        > ../../lib/libutil.a(dict_open.o):(.data+0x2c): undefined reference to
        > `dict_pcre_open'
        > collect2: ld returned 1 exit status
        > make: *** [sendmail] Error 1
        > make: *** [update] Error 1
        >
        > Again, dict_open.o doesn't exist (except in my old back-edup server
        > structure). So, now I've removed the directory and rerun
        >
        > tar - zxvf postfix-2.4.6.tar.gz
        >
        > but the file is still not there. There no dict_*.o in the current
        > /usr/local/src/postfix-2.4.6/src/ directly. So this (and no stupidly
        > linked files as I first thought) would seem to be the issue.
        >
        > Am I okay to continue copying them over? Should I be doing something else?

        It would appear to be a rather stupid question - since I've now been
        informed that make is making these files that I'm recklessly copying
        over. Which means I'm truly stuck.

        Any advice is more than welcome.

        Lydiard
      • Wietse Venema
        ... The build-from-source procedure is described in the INSTALL file. $ make tidy $ make makefiles (options for SQL, PCRE, whatever) $ make Do not copy around
        Message 3 of 4 , Nov 29, 2007
        • 0 Attachment
          Lydiard:
          > It would appear to be a rather stupid question - since I've now been
          > informed that make is making these files that I'm recklessly copying
          > over. Which means I'm truly stuck.
          >
          > Any advice is more than welcome.

          The build-from-source procedure is described in the INSTALL file.

          $ make tidy
          $ make makefiles (options for SQL, PCRE, whatever)
          $ make

          Do not copy around files by hand.

          Wietse
        • Lydiard
          ... Date: Thu, 29 Nov 2007 20:24:52 -0500 (EST) Subject: Re: Postfix with MYSQL compile error ... I always *try* to follow your unstructions to the letter :)
          Message 4 of 4 , Dec 2, 2007
          • 0 Attachment
            ----- Message from wietse@... ---------
            Date: Thu, 29 Nov 2007 20:24:52 -0500 (EST)
            Subject: Re: Postfix with MYSQL compile error

            > Lydiard:
            >> It would appear to be a rather stupid question - since I've now been
            >> informed that make is making these files that I'm recklessly copying
            >> over. Which means I'm truly stuck.
            >>
            >> Any advice is more than welcome.
            >
            > The build-from-source procedure is described in the INSTALL file.
            >
            > $ make tidy
            > $ make makefiles (options for SQL, PCRE, whatever)
            > $ make
            >
            > Do not copy around files by hand.
            >
            > Wietse

            I always *try* to follow your unstructions to the letter :) Seems
            that's ironically where the issue was - my base system is now Debian
            and older and wiser heads have told me to steer clear of tarballs
            entirely. Installed Postfix with Debian-etch packages and everything
            is all there - just one or 2 hiccups.

            Thanks though.

            Lydiard
          Your message has been successfully submitted and would be delivered to recipients shortly.