jones321 jones321 - 1 year ago 147
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/ 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/, 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 Source

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 => /usr/local/lib/ (0x00...)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download