Ad Widget

Collapse

[1.3.9 r4160] libcurl not found if using --enable-static

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Farzad FARID
    Member
    • Apr 2007
    • 79

    #1

    [1.3.9 r4160] libcurl not found if using --enable-static

    Hi,

    Yet another bug in the library detection code This time I am unable to provide a patch because of a lack of time to completely debug the problem.

    I'm running Fedora Core 5 on a 64 bits server. When using this configuration command:
    Code:
    ./configure --prefix=/opt/zabbix-server --enable-server --enable-static --with-mysql --with-libcurl --with-net-snmp
    I get this error message:
    Code:
    checking for main in -lz ... yes
    checking for main in -lcurl... yes
    checking whether libcurl is usable... no
    configure: error: Not found Curl library
    It seems that the configure script correctly links with "-lcurl" when doing the first test (check line configure:8604, but when (and only when) "--enable-static" is used, it forgets "-lcurl" in the list of libraries to link in the second test (check line configure:8724).

    Here is the relevant part of the config.log file:
    Code:
    configure:8575: checking for main in -lcurl
    configure:8604: gcc -o conftest -g -O2   -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexception
    s -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_
    LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv      -static    -L/usr/lib64/mysql -L/usr/lib64    -L/usr/ke
    rberos/lib64 conftest.c -lcurl  -lz  -lcrypto  -lssl  -lidn  -lresolv  -lcom_err  -lkrb5support  -lk5crypt
    o  -lkrb5  -lgssapi_krb5  -ldl  -lresolv -lnsl    -lmysqlclient  -lz -lcrypt -lnsl -lm -lssl -lcrypto   -l
    dl -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err -lresolv -lidn -lssl -lcrypto -lz >&5
    configure:8610: $? = 0
    configure:8628: result: yes
    configure:8681: checking whether libcurl is usable
    configure:8724: gcc -o conftest -g -O2   -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexception
    s -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_
    LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv      -static    -L/usr/lib64/mysql -L/usr/lib64   conftest.c
      -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err -lresolv -lidn -lssl -lcrypto -lz -lz  -lcr
    ypto  -lssl  -lidn  -lresolv  -lcom_err  -lkrb5support  -lk5crypto  -lkrb5  -lgssapi_krb5  -ldl  -lresolv
    -lnsl    -lmysqlclient  -lz -lcrypt -lnsl -lm -lssl -lcrypto  >&5
    /tmp/ccmdXJlJ.o: In function `main':
    /usr/src/ZABBIX/zabbix-1.3.9/conftest.c:128: undefined reference to `curl_easy_setopt'
    collect2: ld returned 1 exit status
    configure:8730: $? = 1
    configure: failed program was:
    | /* confdefs.h.  */
    | #define PACKAGE_NAME ""
    | #define PACKAGE_TARNAME ""
    | #define PACKAGE_VERSION ""
    | #define PACKAGE_STRING ""
    .........
    | #define HAVE_LIBCRYPTO_ 1
    | #define HAVE_LIBZ_ 1
    | #define HAVE_LIBCURL 1
    | /* end confdefs.h.  */
    | #include <curl/curl.h>
    | int
    | main ()
    | {
    |
    | /* Try and use a few common options to force a failure if we are
    |    missing symbols or can't link. */
    | int x;
    | curl_easy_setopt(NULL,CURLOPT_URL,NULL);
    | x=CURL_ERROR_SIZE;
    | x=CURLOPT_WRITEFUNCTION;
    | x=CURLOPT_FILE;
    | x=CURLOPT_ERRORBUFFER;
    | x=CURLOPT_STDERR;
    | x=CURLOPT_VERBOSE;
    |
    |   ;
    |   return 0;
    | }
    configure:8753: result: no
    configure:8934: error: Not found Curl library
    Regards
  • bryancan
    Junior Member
    • Sep 2006
    • 22

    #2
    Did anything ever get worked out on this issue? I really need to compile this --enable-static

    Comment

    • Eugene
      Member
      • Feb 2006
      • 57

      #3
      Please check the version 1.4

      Comment

      • bryancan
        Junior Member
        • Sep 2006
        • 22

        #4
        Version 1.4 does not compile static either. I get the exact same error at the same place during configure.....

        Comment

        • Eugene
          Member
          • Feb 2006
          • 57

          #5
          Please check static libraryes of CURL.

          Code:
           ls -l /usr/lib*/ | grep "libcurl.*a"

          Comment

          • bryancan
            Junior Member
            • Sep 2006
            • 22

            #6
            Mine are in /usr/local/lib:
            libcurl.a
            libcurl.la
            using 7.16.2

            Comment

            • Eugene
              Member
              • Feb 2006
              • 57

              #7
              And what say that commands?

              Code:
              curl-config --version
              curl-config --cflags
              curl-config --libs

              Comment

              • kberrien
                Member
                • Mar 2007
                • 43

                #8
                Same thing...

                Ditto as Farzad using Centos 5 i386

                [root@zabbix ~]# ls -l /usr/lib*/ | grep "libcurl.*a"
                -rw-r--r-- 1 root root 327238 Mar 14 08:35 libcurl.a
                [root@zabbix ~]# whereis libcurl.a
                libcurl: /usr/lib/libcurl.a /usr/lib/libcurl.so /usr/share/man/man3/libcurl.3.gz
                [root@zabbix ~]# curl-config --version
                libcurl 7.15.5
                [root@zabbix ~]# curl-config --cflags

                [root@zabbix ~]# curl-config --libs
                -L/usr/kerberos/lib -lcurl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -ldl -lidn -lssl -lcrypto -lz

                Comment

                • Eugene
                  Member
                  • Feb 2006
                  • 57

                  #9
                  Originally posted by kberrien
                  [root@zabbix ~]# whereis libcurl.a
                  libcurl: /usr/lib/libcurl.a /usr/lib/libcurl.so /usr/share/man/man3/libcurl.3.gz
                  ....
                  [root@zabbix ~]# curl-config --libs
                  -L/usr/kerberos/lib -lcurl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -ldl -lidn -lssl -lcrypto -lz
                  So, Your solution must be:

                  ln -s /usr/lib/libcurl.* /usr/kerberos/lib/

                  Comment

                  • kberrien
                    Member
                    • Mar 2007
                    • 43

                    #10
                    No luck..

                    Originally posted by Eugene
                    So, Your solution must be:

                    ln -s /usr/lib/libcurl.* /usr/kerberos/lib/
                    No such luck. Either with ln -s /usr/lib /usr/kerberos/lib or other variations. I looked into the the zabbix 1.4 configure file, and thus tried:

                    ./configure --enable-server --with-mysql --with-net-snmp --with-libcurl=/usr/bin/ --enable-static --enable-agent

                    the location of my curl-config file, or even =/usr/bin/curl-config, or even tried /usr/lib (locatin of libraries).

                    Stumped. I'm not a c guy, nor a expert at compiling either... heheh

                    Comment

                    • RohrbaGe
                      Senior Member
                      • Aug 2005
                      • 167

                      #11
                      libcurl / net-snmp problem

                      Hi,

                      I guess, that my problems are similiar than yours.



                      I have installed libcurl and net-snmp +devel.


                      In my last comment at that thread I pointed at to threads here in the forum, where a (possible) solution is listed.

                      But I´m not familiar with that sort of stuff, so I do not understand what is to do.

                      Regards
                      Gerald

                      Comment

                      • tbenoit
                        Junior Member
                        • Nov 2006
                        • 9

                        #12
                        I also have this issue (using v1.4 release downloaded today). It only fails if I specify "--enable-static". If I remove that single configure parameter, it compiles:


                        WORKS
                        ./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl=/usr/local/bin/curl-config --prefix=/opt/zabbix --exec-prefix=/opt/zabbix


                        FAILS
                        ./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl=/usr/local/bin/curl-config --enable-static --prefix=/opt/zabbix --exec-prefix=/opt/zabbix


                        Yes, I have to supply the full executable path to curl-config. Simply providing the directory fails.

                        Comment

                        • mucknet
                          Member
                          • Dec 2004
                          • 59

                          #13
                          FWIW this issue is still present in 1.4.1

                          Comment

                          • halfasleep
                            Junior Member
                            • May 2009
                            • 2

                            #14
                            I found I still have this problem in 1.6.4, but if you move --enable-static to the end of the ./configure command it compiles.
                            Code:
                            ./configure  --enable-server --with-mysql --enable-agent  --with-libcurl=/home/admin/zabbix-1.6.4/libcurl/bin/curl-config --enable-static

                            Comment

                            • nmail_uk
                              Member
                              • May 2009
                              • 65

                              #15
                              I had the same issue with 1.6.4 without --enable-static at all.

                              My libcurl (as with all other software) is in a non-standard directory (under /opt.)

                              My workaround was to manually add the cURL directives to the include flags (I believe CFLAGS and LDFLAGS; Zabbix had added the includes for PostgreSQL, but not for cURL.)

                              I don't have access to the machine right now to provide the exact configure line and cURL command outputs but I can do later today.

                              Comment

                              Working...