netlink, link to libnl-3 and libnl-1

2.3k views Asked by At

I have an application that uses libnl. It can use either versions (1 or 3), and during configure it tries first to use ibnl3 and fallback to libnl-1 if libnl3 was not found.

My app uses another library that also uses libnl. The problem is that I only have libnl1-dev on my machine so my app must use it. But the library that I use uses libnl3 (was installed with yum i guess it's static linked) so i have both version and my application crashes!!

here are some prints

ldd myapp.so|grep libnl
        libnl.so.1 => /lib64/libnl.so.1 (0x00007fda33eb5000)
        libnl-route-3.so.200 => /lib64/libnl-route-3.so.200 (0x00007fda32a3d000)
        libnl-3.so.200 => /lib64/libnl-3.so.200 (0x00007fda3281b000)

yum list|grep libnl
    libnl.x86_64                            1.1.4-3.el7               
    libnl-devel.x86_64                      1.1.4-3.el7               
    libnl3.x86_64                           3.2.28-2.el7              
    libnl3-cli.x86_64                       3.2.28-2.el7              
    libnl.i686                              1.1.4-3.el7                
    libnl-devel.i686                        1.1.4-3.el7                
    libnl3.i686                             3.2.28-2.el7               
    libnl3-cli.i686                         3.2.28-2.el7               

if in install libnl3-dev it fixes the issue is there another solution?

1

There are 1 answers

0
Employed Russian On BEST ANSWER

if I install libnl3-dev it fixes the issue is there another solution?

There are other solutions, but the bottom line is that you can only have libnl.so.1 or libnl-3.so.200, but not both.

Fixing this by "going all in on libnl-3" is the simplest solution.

The alternative is to "go all on on libnl-1", which means rebuilding anything that requires libnl-3 from source (against libnl-1). This is assuming that your other dependencies can be built against libnl-1 at all (which is by no means guaranteed).