Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xar is linking to libxar.so.1 in the current directory (Cygwin/Windows 7) #88

Open
GoogleCodeExporter opened this issue Feb 29, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

I was building xar 1.5.2 on Cygwin/Windows 7, but when I run it I normally get 
this output:

> Sophie@Sophie-Laptop:~/xar/xar-1.5.2$ xar
> /usr/local/bin/xar.exe: error while loading shared libraries: libxar.so.1: 
cannot open shared object file: No such file or directory

It seems that it's looking for the file in the current directory, because if I 
cd to the lib/ folder (or /usr/local/lib), it works fine:

> Sophie@Sophie-Laptop:~/xar/xar-1.5.2/lib$ xar
> Usage: xar -[ctx][v] -f <archive> ...
[snipped large argument list]

Using ldd on the compiled executable when in lib/ shows that this is the case:

Sophie@Sophie-Laptop:~/xar/xar-1.5.2/lib$ ldd /usr/local/bin/xar
>         ntdll.dll => /cygdrive/c/Windows/SysWOW64/ntdll.dll (0x774e0000)
>         snxhk.dll => /cygdrive/c/Program Files/AVAST Software/Avast/snxhk.dll 
(0x72310000)
>         KERNEL32.dll => /cygdrive/c/Windows/syswow64/KERNEL32.dll (0x750a0000)
>         KERNELBASE.dll => /cygdrive/c/Windows/syswow64/KERNELBASE.dll 
(0x75420000)
>         cygwin1.dll => /usr/bin/cygwin1.dll (0x61000000)
>         libxar.so.1 => /home/Sophie/xar/xar-1.5.2/lib/libxar.so.1 (0x702c0000)
>         cygbz2-1.dll => /usr/bin/cygbz2-1.dll (0x6a2e0000)
>         cyggcc_s-1.dll => /usr/bin/cyggcc_s-1.dll (0x6c140000)
>         cygcrypto-1.0.0.dll => /usr/bin/cygcrypto-1.0.0.dll (0x69c40000)
>         cygz.dll => /usr/bin/cygz.dll (0x694c0000)
>         cygxml2-2.dll => /usr/bin/cygxml2-2.dll (0x63420000)
>         cygiconv-2.dll => /usr/bin/cygiconv-2.dll (0x66fd0000)

The program itself seems to work fine if used within lib/ or in another 
directory where libxar.so.1 is available:

> Sophie@Sophie-Laptop:~/xar/xar-1.5.2/lib$ xar -c -f xarlib.xar *
> Sophie@Sophie-Laptop:~/xar/xar-1.5.2/lib$ ls -l xarlib.xar
> -rw-r--r-- 1 Sophie None 600335 Dec  6 16:37 xarlib.xar
> Sophie@Sophie-Laptop:~/xar/xar-1.5.2/lib$ xar -t -f xarlib.xar
> appledouble.h
> archive.c
> archive.d
> archive.h
> archive.o
[snipped rest of output]

I have confirmed that it correctly extracts existing .xar files, too.

It seems that the only issue is that it incorrectly links to libxar.so.1 in the 
current directory rather than the one it installed in /usr/local/lib/ . Since I 
don't see any other issues about this problem, I assume it's a Cygwin-specific 
issue, though I haven't had the problem with any other compiled programs. If 
there's anything I can do to help debug, let me know!

Original issue reported on code.google.com by [email protected] on 6 Dec 2014 at 4:47

@partho222
Copy link

Running

sudo ldconfig

have fixed this issue on ubuntu 18.04
error while loading shared libraries: libxar.so.1:

we need to update necessary links and cache to the most recent shared libraries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants