I am trying to build and use a piece of C++
code that uses OpenCV. I am working on Linux, working in Code::Blocks
(and the code was originally also developed on a Linux platform using C::B
).
I followed this to install OpenCV (Ubuntu 12.04 & OpenCV 2.4.3). The project compiles fine, but when I try to execute it, it crashes on launch, with the following message about how it can not find the library:
(file_address): error while loading shared libraries: libopencv_core.so.2.3:
cannot open shared object file: No such file or directory
Process returned 127 (0x7F) execution time : 0.017 s Press ENTER to continue.
I set all the parameters for the linker according to several Code::Blocks
install tutorials.
I also checked in /usr/local/lib/
for my libraries (it is the folder I gave to Code::Blocks' compiler); and while I do have a libopencv_core.so
, a libopencv_core.so.2.4
and a libopencv_core.2.4.3
, I do not have a libopencv_core.so.2.3
.
So I'm wondering what the issue is. Is it about backwards compatibility, i.e. do I have to install the exact same version of OpenCV used to develop the original code? (This would be a bit concerning, since I am trying to make a widely-usable library).
Could I force it to use libopencv_core.so.2.4
instead?
EDIT: I managed to make it work by removing everything and reinstalling with a simple apt-get. Sometimes it's the simplest method that works the best! From now on I'll try to apt-get before following installation tutorials. ;)
Have a nice day!