Ad Widget

Collapse

1.3.4 --with-ldap missing ldflags for -lldap: fails to compile

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abi
    Member
    • Jun 2006
    • 81

    #1

    1.3.4 --with-ldap missing ldflags for -lldap: fails to compile

    hi,

    zabbix 1.3.4 fails to compile with --with-ldap enabled:

    x86_64-linux-gnu-gcc -g -O2 -I/usr/include/mysql -DBIG_JOINS=1 -I/usr/include -L/usr/lib/mysql -lmysqlclient -lm -lz -L/usr/lib -lcurl -L/usr/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err -lresolv -lidn -lssl -lcrypto -ldl -lssl -lcrypto -lz -L/usr/lib -lnetsnmp -lcrypto -o zabbix_agent zabbix_agent.o stats.o cpustat.o diskdevices.o interfaces.o zbxconf.o ../../src/libs/zbxsysinfo/libzbxagentsysinfo.a ../../src/libs/zbxsysinfo/linux/libspecsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxnet/libzbxnet.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a -lresolv -lnsl
    ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a(simple.o): In function `check_ldap':
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:59: undefined reference to `ldap_init'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:65: undefined reference to `ldap_search_s'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:74: undefined reference to `ldap_err2string'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:93: undefined reference to `ber_free'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:94: undefined reference to `ldap_msgfree'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:95: undefined reference to `ldap_unbind'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:78: undefined reference to `ldap_first_entry'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:84: undefined reference to `ldap_first_attribute'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:86: undefined reference to `ldap_get_values'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:91: undefined reference to `ldap_value_free'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:92: undefined reference to `ldap_memfree'
    /home/abi/deb/build-area/zabbix-1.3.4/src/libs/zbxsysinfo/simple/simple.c:80: undefined reference to `ldap_err2string'
    looking at the Makefile it seems like LDFLAGS is missing the -lldap switch:

    LDFLAGS = -L/usr/lib/mysql -lmysqlclient -lm -lz -L/usr/lib -lcurl -L/usr/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err -lresolv -lidn -lssl -lcrypto -ldl -lssl -lcrypto -lz -L/usr/lib -lnetsnmp -lcrypto
    LIBLDAP_LDFLAGS are, however, defined:

    LIBLDAP_CPPFLAGS = -I
    LIBLDAP_LDFLAGS = -L -lldap
    adding -lldap to LDFLAGS by hand does the job for me, not sure where
    the error exactly is.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Thanks for reporting this. You're very quick!
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      The problem was fixed in pre 1.3.5.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • transitv
        Junior Member
        • Dec 2006
        • 22

        #4
        Is pre 1.3.5 (and all future builds) available via the svn?

        Comment

        • abi
          Member
          • Jun 2006
          • 81

          #5
          Originally posted by transitv
          Is pre 1.3.5 (and all future builds) available via the svn?
          yes. see /trunk/ on svn.zabbix.com

          Comment

          • Antixrict
            Junior Member
            • Mar 2007
            • 4

            #6
            Not work for me
            I use opensuse 10.1 and openldap 2.3.27
            i try add in Makefile LDFLAGS=-L -lldap , not work...
            and unfortuntly i can't use your svn becaouse i have only ftp/http access
            P.S.
            I think i found other way:
            1)./configure --with-net-snmp --enable-server --enable-agent --prefix=/usr --with-mysql
            2)make && make install
            3)./configure --with-ldap --prefix=/usr
            4)make && make install
            all done
            Last edited by Antixrict; 14-04-2007, 08:30.

            Comment

            Working...