Error loading loadable libraries using VLFeat in C

I am trying to use the VLFeat library in C as indicated on the website http://www.vlfeat.org/gcc.html .

I downloaded and installed the library. I am using architecture glnxa64. The library is in/A/B/C/vlfeat-0.9.18

My code is as follows:

    extern "C" {
    #include <vl/generic.h>
    #include <vl/sift.h>
    }

    int main (int argc, const char * argv[]) 
    {
    VL_PRINT ("Hello world!") ;
    return 0;
    }

I will compile my code using the following statement

g++ main.cpp -o vlfeat-test -I/A/B/C/vlfeat-0.9.18 -L/A/B/C/vlfeat-0.9.18/bin/glnxa64/ -lvl

But when I run it, I get the following error

./vlfeat-test: error while loading shared libraries: libvl.so: cannot open shared object file: No such file or directory
+4
source share
4 answers

When your program is loaded, Linux loads the necessary libraries.

You need to create a symbolic link in / usr / lib / in the libvl.so file

sudo ln -s /home/[YourPATH]/vlfeat-0.9.20/bin/[YourArchitecture]/libvl.so /usr/lib/libvl.so
+2
source

Before running the test in the same console:

export LD_LIBRARY_PATH=/A/B/C/vlfeat-0.9.18/bin/glnxa64:$LD_LIBRARY_PATH

then

./vlfeat-test
+1

, . Linux , vl.

libvl.so /usr/lib

sudo cp [VLFEAT_PATH]/bin/[YOUR_ARCHITECTURE]/libvl.so /usr/lib
+1

[ .mex MATLAB Ubuntu].

, ,

sudo ldconfig

/A/B/C/vlfeat-0.9.18/bin/glnxa64 ( ) , , /home/username/lib ldconfig:

sudo vim /etc/ld.so.conf

()

/A/B/C/vlfeat-0.9.18/bin/glnxa64

,

ldconfig -v | grep libvl.so
0

Source: https://habr.com/ru/post/1535190/


All Articles