jones321 jones321 - 1 month ago 25
C++ Question

update curl on centos

There is curl v7.19.7 on my cnetos. Since I want to develop c++ program to send email, I got the curl v7.50.3 source code and install it(configure, make, make install). Although my c++ program build successfully, but when I try to execute it, there are errors:

* Protocol smtp not supported or disabled in libcurl
* Unsupported protocol
curl_easy_perform() failed: Unsupported protocol


When I proceed command: curl --version, it shows:

curl 7.50.3 (x86_64-pc-linux-gnu) libcurl/7.19.7 NSS/3.13.6.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2


It seems libcurl still refer to the older version!

Although I try to

1. rpm -q curl
2. rpm -e --nodeps curl-7.19.7-35.el6.x86_64


but it comes out no difference. I also add "/usr/local/lib" in /etc/ld.so.conf, still not working!

How can I do to remove old version curl library(v7.19.7) clearly, let my c++ program refer to the new version curl(v7.50.3)?

Answer

Try using "ldd" on your executable to check what version of curl it is using.

Make sure the libcurl path matches "/usr/local/lib" or whereever you installed the curl you compiled

[user@computer bin]$ ldd myExecutable | grep curl
libcurl.so.4 => /usr/local/lib/libcurl.so.4 (0x00...)