Ad Widget

Collapse

Compile Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #16
    No idea then man. I know it's not gonna help ya, but I will try to get a FC / CentOS system going this evening and see if I can work through it. I can't promise anything though.
    Last edited by James Wells; 26-10-2005, 03:29.
    Unofficial Zabbix Developer

    Comment

    • rushowr
      Member
      • Jul 2005
      • 30

      #17
      Thanks, I appreciate it.

      Anyone else have a possible solution?

      This is a CentOS 3 machine, MySQL 4.1.15, PHP5...


      Thanks

      Comment

      • tez
        Junior Member
        • Nov 2005
        • 5

        #18
        If you move the existing -lmysqlclient from the middle of the arguments to gcc to the end instead, the compile and link works with no errors.

        Observe:

        [tez@parodius zabbix_server]$ cat /etc/redhat-release
        CentOS release 4.2 (Final)
        [tez@parodius zabbix_server]$ gcc -g -O2 -o zabbix_server -L/usr/lib/mysql -lmysqlclient -lm -lz -L/usr/lib -lnetsnmp -lcrypto evalfunc.o expression.o actions.o zlog.o functions.o server.o ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxsysinfo/linux/libzbxsysinfo2.a ../libs/zbxlog/libzbxlog.a ../libs/zbxpid/libzbxpid.a ../libs/zbxconf/libzbxconf.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxnet/libzbxnet.a pinger/libzbxpinger.a poller/libzbxpoller.a escalator/libzbxescalator.a housekeeper/libzbxhousekeeper.a alerter/libzbxalerter.a timer/libzbxtimer.a trapper/libzbxtrapper.a ../libs/zbxemail/libzbxemail.a ../libs/zbxdbhigh/libzbxdbhigh.a ../libs/zbxcommon/libzbxcommon.a -lresolv -lnsl
        evalfunc.o(.text+0x51c): In function `evaluate_FUNCTION':
        /home/tez/zabbix/zabbix-1.1beta2/src/zabbix_server/evalfunc.c:342: undefined reference to `mysql_free_result'
        evalfunc.o(.text+0xdaa): In function `evaluate_FUNCTION2':
        /home/tez/zabbix/zabbix-1.1beta2/src/zabbix_server/evalfunc.c:718: undefined reference to `mysql_free_result'
        evalfunc.o(.text+0xdbc):/home/tez/zabbix/zabbix-1.1beta2/src/zabbix_server/evalfunc.c:703: undefined reference to `mysql_free_result'
        expression.o(.text+0xfaf): In function `substitute_simple_macros':
        /home/tez/zabbix/zabbix-1.1beta2/src/zabbix_server/expression.c:856: undefined reference to `mysql_free_result'
        expression.o(.text+0x10c9):/home/tez/zabbix/zabbix-1.1beta2/src/zabbix_server/expression.c:882: undefined reference to `mysql_free_result'
        actions.o(.text+0x349):/home/tez/zabbix/zabbix-1.1beta2/src/zabbix_server/actions.c:161: more undefined references to `mysql_free_result' follow
        ../libs/zbxdbhigh/libzbxdbhigh.a(db.o)(.text+0xc): In function `DBclose':
        /home/tez/zabbix/zabbix-1.1beta2/src/libs/zbxdbhigh/db.c:47: undefined reference to `mysql_close'
        ../libs/zbxdbhigh/libzbxdbhigh.a(db.o)(.text+0x29): In function `DBconnect':
        /home/tez/zabbix/zabbix-1.1beta2/src/libs/zbxdbhigh/db.c:69: undefined reference to `mysql_error'
        <snip>
        ../libs/zbxdbhigh/libzbxdbhigh.a(action.o)(.text+0x636):/home/tez/zabbix/zabbix-1.1beta2/src/libs/zbxdbhigh/action.c:131: more undefined references to `mysql_free_result' follow
        collect2: ld returned 1 exit status
        [tez@parodius zabbix_server]$ gcc -g -O2 -o zabbix_server -L/usr/lib/mysql -lm -lz -L/usr/lib -lnetsnmp -lcrypto evalfunc.o expression.o actions.o zlog.o functions.o server.o ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxsysinfo/linux/libzbxsysinfo2.a ../libs/zbxlog/libzbxlog.a ../libs/zbxpid/libzbxpid.a ../libs/zbxconf/libzbxconf.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxnet/libzbxnet.a pinger/libzbxpinger.a poller/libzbxpoller.a escalator/libzbxescalator.a housekeeper/libzbxhousekeeper.a alerter/libzbxalerter.a timer/libzbxtimer.a trapper/libzbxtrapper.a ../libs/zbxemail/libzbxemail.a ../libs/zbxdbhigh/libzbxdbhigh.a ../libs/zbxcommon/libzbxcommon.a -lresolv -lnsl -lmysqlclient
        [tez@parodius zabbix_server]$

        I can't understand why the Zabbix developers didn't catch this one sooner as gcc and ld will always load libraries from the end of the command-line *first* in order to satisfy dependencies for the source files specified at the beginning.

        I am using the official MySQL 5.0.15 RPMs from http://www.mysql.com/ as CentOS and Fedora have yet to release their own.

        Regards,
        Terry Froy
        Spilsby Internet Solutions

        Comment

        • James Wells
          Senior Member
          • Jun 2005
          • 664

          #19
          Originally posted by tez
          I can't understand why the Zabbix developers didn't catch this one sooner as gcc and ld will always load libraries from the end of the command-line *first* in order to satisfy dependencies for the source files specified at the beginning.
          AWESOME!!!. Thank you Terry. Don't know about anyone else, but I was unaware of this. Actually, this kind of makes sense considering one of the patches I submitted a while back had -lmysqlclient to the end of the linker line, but the patch just before mine had it at the front of the line and it failed.

          Again, thank you very much.
          Unofficial Zabbix Developer

          Comment

          • Lostnode
            Junior Member
            • Nov 2005
            • 22

            #20
            I did all this, and now I get this
            Code:
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x178):/zabbix/src/zabbix_server/poller/checks_snmp.c:122: undefined reference to `usmHMACMD5AuthProtocol'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x19e):/zabbix/src/zabbix_server/poller/checks_snmp.c:131: undefined reference to `usmHMACMD5AuthProtocol'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x1a3):/zabbix/src/zabbix_server/poller/checks_snmp.c:131: undefined reference to `generate_Ku'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x1f0):/zabbix/src/zabbix_server/poller/checks_snmp.c:153: undefined reference to `snmp_open'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x218):/zabbix/src/zabbix_server/poller/checks_snmp.c:164: undefined reference to `snmp_pdu_create'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x236):/zabbix/src/zabbix_server/poller/checks_snmp.c:165: undefined reference to `read_objid'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x246):/zabbix/src/zabbix_server/poller/checks_snmp.c:173: undefined reference to `snmp_add_null_var'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x265):/zabbix/src/zabbix_server/poller/checks_snmp.c:176: undefined reference to `snmp_synch_response'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x2e7):/zabbix/src/zabbix_server/poller/checks_snmp.c:307: undefined reference to `snmp_sess_perror'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x307):/zabbix/src/zabbix_server/poller/checks_snmp.c:314: undefined reference to `snmp_free_pdu'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x313):/zabbix/src/zabbix_server/poller/checks_snmp.c:316: undefined reference to `snmp_close'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x357):/zabbix/src/zabbix_server/poller/checks_snmp.c:299: undefined reference to `snmp_sess_perror'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x36e):/zabbix/src/zabbix_server/poller/checks_snmp.c:281: undefined reference to `snmp_errstring'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x398):/zabbix/src/zabbix_server/poller/checks_snmp.c:290: undefined reference to `snmp_errstring'
            poller/libzbxpoller.a(checks_snmp.o)(.text+0x3bd):/zabbix/src/zabbix_server/poller/checks_snmp.c:285: undefined reference to `snmp_errstring'
            /usr/lib/mysql/libmysqlclient.a(my_compress.o)(.text+0xbc): In function `my_compress_alloc':
            Version 1 worked great, cept for an email problem I have had... now I have spent the last 5 hours browsing the forums, scratchin my head, pulling out my hair because I cannot get htis work... I am on RHE 3... please help.

            Comment

            • rxm8028
              Member
              • Apr 2005
              • 45

              #21
              Same for me

              I am experiencing the same (or very similar) difficulty while attempting to compile zabbix 1.1beta2 on SuSE 9.3.
              I have installed the following RPMs:
              net-snmp version 5.2.1-5.2
              net-snmp-devel version 5.2.1-5.2
              MySQL-client version 5.0.15-0
              MySQL-devel version 5.0.15-0
              MySQL-server version 5.0.15-0
              MySQL-shared version 5.0.15-0

              as well as the source package for MySQL 5.0.15-0.

              ./configure --enable-server --enable-agent --with-mysql --with-net-snmp works without complaint, but when I run make, I see the errors mentioning undefined references to 'mysql_free_resilt'. I have tried the solutions from every post in these forums that mention compile errors (as of Nov. 18, 2005), but with no success. My only other guess is that perhaps the gcc version 3.3.5 that comes in this distribution may be the problem.

              Ideas, anyone?

              Thanks,

              Comment

              • elkor
                Senior Member
                • Jul 2005
                • 299

                #22
                I doubt it's a gcc issue.

                try adding the mysql include parameters to the END of the offending gcc command line instead of the begining.
                Somebody pointed out recently that gcc reads the command line from the end first in order to resolve dependencies, perhaps this is the problem.

                Comment

                • rxm8028
                  Member
                  • Apr 2005
                  • 45

                  #23
                  OK, seems to have worked

                  Well, I'm no C programmer, so it took me a while to figure out what I was looking at, but I finally determined that changing the Makefile in the zabbix_server source directory was the thing to do. I changed the line reading

                  zabbix_server_LDFLAGS = -L/usr/lib/mysql -lmysqlclient -lm -lz -L/usr/lib -lnetsnmp -lcrypto

                  so that it now reads

                  zabbix_server_LDFLAGS = -L/usr/lib -lnetsnmp -lcrypto -L/usr/lib/mysql -lmysqlclient -lm -lz

                  and make runs with no errors.

                  Thanks to all for the suggestions.

                  Ross

                  Comment

                  • BFGoodrich
                    Junior Member
                    • Nov 2005
                    • 9

                    #24
                    I don't see that line in the Makefile?

                    I have MySQL installed in /usr/local/mysql

                    I have installed the shared libraries for mysql under /usr/lib

                    I tried the following...

                    ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql=/usr/local/mysql --with-net-snmp

                    I then attempted a make and had the following output (more errors follow)

                    gcc -g -O2 -o zabbix_server -L/usr/local/mysql/lib -lmysqlclient -lm -lz -L/usr/lib -lnetsnmp evalfunc.o expression.o actions.o zlog.o functions.o server.o ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxsysinfo/linux/libzbxsysinfo2.a ../libs/zbxlog/libzbxlog.a ../libs/zbxpid/libzbxpid.a ../libs/zbxconf/libzbxconf.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxnet/libzbxnet.a pinger/libzbxpinger.a poller/libzbxpoller.a escalator/libzbxescalator.a housekeeper/libzbxhousekeeper.a alerter/libzbxalerter.a timer/libzbxtimer.a trapper/libzbxtrapper.a ../libs/zbxemail/libzbxemail.a ../libs/zbxdbhigh/libzbxdbhigh.a ../libs/zbxcommon/libzbxcommon.a -lresolv -lnsl
                    evalfunc.o(.text+0x652): In function `evaluate_FUNCTION':
                    /usr/local/downloads/zabbix-1.1beta2/src/zabbix_server/evalfunc.c:342: undefined reference to `mysql_free_result'

                    Any ideas, what specific things do I need to modify in Makefile?

                    Thanks,

                    Benjamin Goodrich

                    Comment

                    • BFGoodrich
                      Junior Member
                      • Nov 2005
                      • 9

                      #25
                      Ok...

                      I found another Makefile under src/zabbix_server

                      changing this Makefile variable did help
                      zabbix_server_LDFLAGS = -L/usr/lib -lnetsnmp -lcrypto -L/usr/lib/mysql -lmysqlclient -lm -lz

                      However, now I am getting yet another compile error.

                      This time...

                      gcc -g -O2 -o zabbix_server -L/usr/lib -lnetsnmp -L/usr/lib/mysql -lmysqlclient -lm -lz evalfunc.o expression.o actions.o zlog.o functions.o server.o ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxsysinfo/linux/libzbxsysinfo2.a ../libs/zbxlog/libzbxlog.a ../libs/zbxpid/libzbxpid.a ../libs/zbxconf/libzbxconf.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxnet/libzbxnet.a pinger/libzbxpinger.a poller/libzbxpoller.a escalator/libzbxescalator.a housekeeper/libzbxhousekeeper.a alerter/libzbxalerter.a timer/libzbxtimer.a trapper/libzbxtrapper.a ../libs/zbxemail/libzbxemail.a ../libs/zbxdbhigh/libzbxdbhigh.a ../libs/zbxcommon/libzbxcommon.a -lresolv -lnsl
                      /usr/lib/libnetsnmp.so: undefined reference to `EVP_DigestInit'
                      /usr/lib/libnetsnmp.so: undefined reference to `EVP_DigestFinal'
                      /usr/lib/libnetsnmp.so: undefined reference to `EVP_DigestFinal_ex'
                      /usr/lib/libnetsnmp.so: undefined reference to `AES_set_encrypt_key'
                      /usr/lib/libnetsnmp.so: undefined reference to `EVP_md5'
                      /usr/lib/libnetsnmp.so: undefined reference to `HMAC'
                      /usr/lib/libnetsnmp.so: undefined reference to `EVP_MD_CTX_cleanup'
                      /usr/lib/libnetsnmp.so: undefined reference to `SSLeay'
                      /usr/lib/libnetsnmp.so: undefined reference to `EVP_sha1'
                      /usr/lib/libnetsnmp.so: undefined reference to `EVP_MD_CTX_init'
                      /usr/lib/libnetsnmp.so: undefined reference to `EVP_DigestUpdate'
                      /usr/lib/libnetsnmp.so: undefined reference to `RAND_bytes'
                      /usr/lib/libnetsnmp.so: undefined reference to `DES_cbc_encrypt'
                      /usr/lib/libnetsnmp.so: undefined reference to `DES_ncbc_encrypt'
                      /usr/lib/libnetsnmp.so: undefined reference to `DES_key_sched'
                      /usr/lib/libnetsnmp.so: undefined reference to `AES_cfb128_encrypt'
                      collect2: ld returned 1 exit status
                      make[3]: *** [zabbix_server] Error 1
                      make[3]: Leaving directory `/usr/local/downloads/zabbix-1.1beta2/src/zabbix_server'
                      make[2]: *** [all-recursive] Error 1
                      make[2]: Leaving directory `/usr/local/downloads/zabbix-1.1beta2/src/zabbix_server'
                      make[1]: *** [all-recursive] Error 1
                      make[1]: Leaving directory `/usr/local/downloads/zabbix-1.1beta2/src'
                      make: *** [all-recursive] Error 1

                      What are the dependencies for Zabbix? Am I missing something here?

                      Comment

                      • krusty
                        Senior Member
                        • Oct 2005
                        • 222

                        #26
                        Have you install the net-snmp-devel, gcc-devel, mysql-devel packet?

                        Comment

                        • BFGoodrich
                          Junior Member
                          • Nov 2005
                          • 9

                          #27
                          Installed SNMP, MySQL, and gcc-devel

                          Have you install the net-snmp-devel, gcc-devel, mysql-devel packet?

                          I have installed MySQL into /usr/local
                          I have installed MySQL shared into /usr/lib
                          I have installed net-snmp into /usr/snmp (due to the error, tried to compile w/ SSL)
                          I have installed OpenSSL into /usr/local/ssl
                          GCC and development libraries are installed.

                          Any ideas?

                          Comment

                          • BFGoodrich
                            Junior Member
                            • Nov 2005
                            • 9

                            #28
                            Any Help?

                            I have not heard back from anyone. Is there a list of packages/dependencies that this product requires and how to do a proper configure with these components. I am still trying to get this to work on SUSE 9 Enterprise without much luck. I have installed my own version of MySQL, Apache, PHP, SSL, net-snmp (w/ SSL). Any help with this would be most appreciated.

                            Comment

                            • krusty
                              Senior Member
                              • Oct 2005
                              • 222

                              #29
                              if you use suse you have to look to the suse specific links. i can advise to use the suse original packages. If you installed your own packages only to have a system therewith it is up to date. Use after Suse installation the update function. Check it out with the original packages.

                              Comment

                              • BFGoodrich
                                Junior Member
                                • Nov 2005
                                • 9

                                #30
                                Even if it works with the SUSE packages, I still need to use my own versions. Their version of MySQL for SLES9 is dated, this also applies to Apache, PHP, etc. What I really need is a list of applications/dependencies that Zabbix requires. Like minimum software requirements and the correct order of flags for gcc. Is there somewhere that I can find this information?

                                Comment

                                Working...