Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tried to debug a C application with Eclipse using GDB but I got the following error:

Error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

I tried to install libncurses5 but it's already installed.

Should I change the location of this package? any idea?


This is what I got after running locate libncurses.

# locate libncurses
/home/sina/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,any,any,any,libncurses5-dbg,page,1,helpful,,187a06d92ba0b73dd50444293b7cab16
/home/sina/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,quantal,any,libncurses5-dbg,page,1,helpful,,e8f56bcf979e4c966af1cf8fcfb46b89
/home/sina/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,raring,any,libncurses5-dbg,page,1,helpful,,9e8b7962287c629e99b01502879a8f35
/home/sina/Downloads/libncurses5-dbg_5.9+20130608-1ubuntu1_i386.deb
/lib/x86_64-linux-gnu/libncurses.so.5
/lib/x86_64-linux-gnu/libncurses.so.5.9
/lib/x86_64-linux-gnu/libncursesw.so.5
/lib/x86_64-linux-gnu/libncursesw.so.5.9
/usr/lib/libncurses++_g.a
/usr/lib/libncurses_g.a
/usr/lib/debug/libncurses.so.5
/usr/lib/debug/libncurses.so.5.9
/usr/lib/debug/lib/x86_64-linux-gnu/libncurses.so.5.9
/usr/lib/debug/lib32/libncurses.so.5.9
/usr/lib/debug/lib32/libncursesw.so.5.9
/usr/lib/debug/usr/libx32/libncurses.so.5.9
/usr/lib/debug/usr/libx32/libncursesw.so.5.9
/usr/lib/x86_64-linux-gnu/libncurses++.a
/usr/lib/x86_64-linux-gnu/libncurses.a
/usr/lib/x86_64-linux-gnu/libncurses.so
/usr/share/doc/libncurses5
/usr/share/doc/libncurses5-dbg
/usr/share/doc/libncurses5-dev
/usr/share/doc/libncursesw5
/var/cache/apt/archives/libncurses5-dbg_5.9-10ubuntu4_amd64.deb
/var/lib/dpkg/info/libncurses5-dbg.list
/var/lib/dpkg/info/libncurses5-dbg.md5sums
/var/lib/dpkg/info/libncurses5-dbg.postinst
/var/lib/dpkg/info/libncurses5-dev.list
/var/lib/dpkg/info/libncurses5-dev.md5sums
/var/lib/dpkg/info/libncurses5-dev.postinst
/var/lib/dpkg/info/libncurses5:amd64.list
/var/lib/dpkg/info/libncurses5:amd64.md5sums
/var/lib/dpkg/info/libncurses5:amd64.postinst
/var/lib/dpkg/info/libncurses5:amd64.postrm
/var/lib/dpkg/info/libncurses5:amd64.shlibs
/var/lib/dpkg/info/libncurses5:amd64.symbols
/var/lib/dpkg/info/libncursesw5:amd64.list
/var/lib/dpkg/info/libncursesw5:amd64.md5sums
/var/lib/dpkg/info/libncursesw5:amd64.postinst
/var/lib/dpkg/info/libncursesw5:amd64.postrm
/var/lib/dpkg/info/libncursesw5:amd64.shlibs
/var/lib/dpkg/info/libncursesw5:amd64.symbols
share|improve this question
    
what does 'locate libncurses' return on the command line? –  kervin Nov 17 '13 at 2:57
    
Are you trying to debug a 32-bit application? –  Braiam Nov 21 '13 at 17:49
add comment

1 Answer

You need to install the debugging symbols for debugging applications:

sudo apt-get install libncurses5-dbg

The -dbg means debug which is the symbols your are lacking.

share|improve this answer
    
I did install that package...still get the same error. That's truly bizarre! None of the target programs use the ncurses library and in fact it is not in the target file system. I have no clue why the debugger would be trying to load libncurses. –  Sina Nov 21 '13 at 6:30
    
gdb itself depends on libncurses5 - it's probably not trying to load it for your target (and probably doesn't need libncurses5-dev or libncurses5-dbg). You could try ldd $(which gdb) to see if anything looks broken - or purge and reinstall gdb itself maybe? –  steeldriver Nov 21 '13 at 17:30
    
root@sina-linux:~# ldd $(which gdb) linux-vdso.so.1 => (0x00007fff609fe000) libreadline.so.6 => /lib/x86_64-linux-gnu/libreadline.so.6 (0x00007f84ae320000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f84ae11c000) libncurses.so.5 => /lib/x86_64-linux-gnu/libncurses.so.5 (0x00007f84adefa000) libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f84adcd2000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f84adabb000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f84ad7b5000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f84ad598000) –  Sina Nov 22 '13 at 3:30
    
libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007f84ad069000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f84ace3f000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f84aca76000) /lib64/ld-linux-x86-64.so.2 (0x00007f84ae57d000) libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f84ac873000) –  Sina Nov 22 '13 at 3:30
    
make any sense? –  Sina Nov 22 '13 at 3:30
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.