unable to link against a 'c' shared library
Hello everybody.
This is my first post here and I have a problem that I am not able to solve for some time now. I have written a piece of software on a MAC and have been attempting to port it to SuSe 11.1. The problem is that one of the libraries that is used by the code refuses to link. It could be because it doesn't like very much, but I am hoping that the explanation is simpler. The library is called vl (http://www.vlfeat.org/). It is made in c and compiles fine. Thereafter I copy libvl.so to /usr/local/lib and the header files in /usr/local/include. My source compiles fine. The offending command is: Quote:
Quote:
Quote:
Please let me know what I am missing. I will appreciate any help. Cheers |
Did you check versioning of the libraries? Perhaps the interfaces have changed between versions, messing up the linking.
Not a g++ expert, but does the order of the parameters matter for the g++ command above? ie do you not need to put the -l options before the .o files? Might want to have a look at LD_LIBRARY_PATH environment variable too. |
Is your software written in C or C++? I had a similar problem while I was trying to link a C++ program against C ffmpeg library. As a solution I had to use wrap the includes with extern "C" to make it work. But it looks like, that your piece of software is written in C, because the compiler doesn't try to link against the functions with C++ decorations. As mentioned above it may really be because of different compiler versions.
|
Yes, yes, yes! That is it! My software is C++ while the library is C. I just added:
Quote:
Thanks a lot maslik! |
I'm glad I could help you :).
|
All times are GMT -5. The time now is 05:09 PM. |