curl: (2) Failed Initialization

后端 未结 2 2023
攒了一身酷
攒了一身酷 2021-01-13 06:40

I have installed libcurl 7.33.0 on Linux. I used the following commands to install:

./configure  
make  
make install

If I run curl h

相关标签:
2条回答
  • 2021-01-13 07:01

    At a wild guess, you've linked the /usr/local/bin/curl binary to the system curl library.

    To verify that this is the case, you should do:

    ldd /usr/local/bin/curl
    

    If it indicates a line like:

    libcurl.so.4 => /usr/lib/x86_64-linux-gnu/libcurl.so.4 (0x00007fea7e889000)
    

    It means that the curl binary is picking up the system curl library. While it was linked at compile time to the correct library, at run-time it's picking up the incorrect library, which seems to be a pretty typical reason for this error happening.

    If you run the configure with --disable-shared, then it will produce a .a, which, when linked to the curl binary will not depend on the system libcurl.so, but will instead have it's own private code.

    If you're cross-compiling, then you'll also need to cross-compile all the dependent libraries, and that is another question.

    0 讨论(0)
  • 2021-01-13 07:01

    Ubuntu does include curl by default as far as I know. So if you don't need specifically the 7.33.0 version, then purge it and install it again from the repository.

    #remove everything you had with curl
    sudo apt-get purge curl
    #optional update
    sudo apt-get update && sudo apt-get upgrade
    #install it from repository
    sudo apt-get install curl 
    
    0 讨论(0)
提交回复
热议问题