Discussion:
[anjuta-devel] How to debug this issue?
Igor Korot
2016-08-14 02:38:52 UTC
Permalink
Hi,
I have 2 machines with Gentoo Linux installed.
One is running KDE 4 with Anjuta 3.18.2, the second I recently upgraded and its
running GNOME 3 with 3.18.2.
I am trying to build my program which is based on the wxWidgets.
On the first KDE machine I'm building it against GTK+2. On the second
- against GTK+3.

Everything is the same - project< Makefiles, the source code.
Everything builds fine on both machines.

However, on the first one I execute the program without any errors, on the
second one - I'm receiving an error - "library cannot be found".

This library is part of the project I created.

How can you check for such an issues?

Thank you.
Sébastien Granjoux
2016-08-16 13:21:38 UTC
Permalink
Hi,
Post by Igor Korot
However, on the first one I execute the program without any errors, on the
second one - I'm receiving an error - "library cannot be found".
This library is part of the project I created.
How can you check for such an issues?
You need to check that your library is installed at the right place. I
think it's possible that you library cannot be loaded because one
dependency is missing.


Regards,

Sébastien
John Coppens
2016-08-16 20:15:13 UTC
Permalink
On Sat, 13 Aug 2016 22:38:52 -0400
Post by Igor Korot
However, on the first one I execute the program without any errors, on the
second one - I'm receiving an error - "library cannot be found".
Possibly, you are calling a function from some library which is only loaded
on execution. I've never seen the error message "library cannot be found"
literally. Is this the exact message? There should be more information about
which library is missing.

If you *have* the library, then it is possible it can't be found, because
the library search path does not include the library where it is installed.

Which language? C, C++ or Python?

Do a

ldd executable

in the src directory of your project ('executable' the name of your project)
It'll show all libraries your program is linked against.

Do a

echo $LD_LIBRARY_PATH

to check the path. If nothing appears, only /usr/lib and /usr/local/lib will
be searched (if I recall correctly).

John
John Coppens
2016-08-16 20:19:58 UTC
Permalink
On Sat, 13 Aug 2016 22:38:52 -0400
Post by Igor Korot
How can you check for such an issues?
Finally, you can also try to trace the execution:

strace <your_exec> 2> execlog

The 'execlog' output will show all actions leading to the missing lib,
and all the paths followed to try and find it. It will be looong, but
you can open it in an editor and search.

John

Loading...