how to make use of old system libraries

We have a project and shared libraries libprivate.so (private so) which was using old libraries libcurl.so.3. The system was upgraded with new system libraries libcurl.so.4.

For some internal issues, right now we do not want to make use of latest libraries libcurl.so.4, we want to make use of libcurl.so.3.

Hence I copied libcurl.so.3 in local folder and set LD_LIBRARY_PATH according. When I link my entire project it says that there is version conflict between libcurl.so.4 and libcurl.so.3 required libprivate.so (libprivate.so is compiled long time ago with libcurl.3.so).

Should I not worry about this warning and proceed further?

When I correctly specify LD_LIBRARY_PATH which has libcurl.so.3, why it is taking from system directory /usr/lib64/libcurl.so.4? when I do ldd my_binary, it takes from libcurl.so.4. How do I stop it? Specifying -L with specific location also doesn't work. Modiying /etc/ld.conf will do for the entire system. I want to make this when I ran my project.

Specifying explicit path it works like /home/mydir/libcurl.so.3, but I do not want to do it.

I want to have these conditions only when I execute my project. In other cases it can make use of latest libraries.

Thanks for your help

Answers


If the command you show in your comment is correct:

gcc test.c -L~/lib/x86_64/ -lcurl -o test

... then you need a space between -L and ~/lib/x86_64/ or the shell won't expand the ~, so the linker is not looking in the right directory.

So you need either:

gcc test.c -L ~/lib/x86_64/ -lcurl -o test

or:

gcc test.c -L$HOME/lib/x86_64/ -lcurl -o test

(You don't need a space here because variables are expanded anywhere in a word, but ~ is only expanded at the start of a word.)


Need Your Help

Is IF(AND(OR... formula's in excel 2010 possible?

excel if-statement excel-2010 nested-loops nested-if

I have the formula below based on some threads from this thread but I am getting an error.

Should I make my Prism views a special View class?

c# wpf mvvm prism prism-4

I normally just use UserControl for a view, but during this project I thought it might be better to derive a View class from that, and use that as the 'containing' class for views, to allow me to