View topic - IDE debugging problem with dynamic library

Page 1 of 1

IDE debugging problem with dynamic library

PostPosted: Tue May 04, 2010 12:42 pm
by Ericxx
Hello,

I am debugging an application in QNX IDE4.0.1, where i dynamically linked with two libraries, libxxx.so and libyyy.so, complied ok, but when i tried to debug it in the target via the debug function in the IDE, prompted the following errors and the IDE got stuck until restart it,

Libxxx.so.1: No such file or directory
Error while mapping shared library sections:
Libyyy.so.1: No such file or directory
Error while mapping shared library sections:
Libxxx.so.1: No such file or directory
Error while mapping shared library sections:
Libyyy.so.1: No such file or directory
Stopped due to share library event


Look forward to suggestions. Thank you.
Eric

RE: IDE debugging problem with dynamic library

PostPosted: Tue May 04, 2010 2:54 pm
by maschoen
There's a global variable, like PATH that indicates where to look for shared libraries.
You can check it's value this way:

# getconf CS_LIBPATH

and you can add paths this way:

# setconf CS_LIBPATH $(getconf CS_LIBPATH):/usr/local/lib

RE: IDE debugging problem with dynamic library

PostPosted: Tue May 04, 2010 2:59 pm
by Ericxx
Thank you, maschoen. But since i built the os image for the target, thus "getconf" is not included in the image. Is there any other way that i can tell the executable application to link the libraries i transferred to the target? I put the executable file and libraries all in the same directory. But did not work. Thanks again.

Eric

RE: IDE debugging problem with dynamic library

PostPosted: Tue May 04, 2010 3:09 pm
by mario
The libraries has to be in the LIBPATH, unless you manually load them dlopen() in the program. I don't know of any wait around this. Either you put the library in say /lib or you modify LIBPATH in the image to include the directory where they will be.

You can also set the env LD_LIBRARY_PATH i believe.

RE: IDE debugging problem with dynamic library

PostPosted: Tue May 04, 2010 4:05 pm
by maschoen
Mario,

This has always been a bit confusing to me so I hope this gets worked out here. The CS_LIBPATH is what I needed to get pkgsrc working. Isn't one of these variables just a message to the linker as to where to look?

Mitchell

RE: IDE debugging problem with dynamic library

PostPosted: Tue May 04, 2010 4:34 pm
by Ericxx
Thanks, mario and maschoen. I have solved the problem. I checked my image build project and found the shared library directory located in /proc/boot. then i copied the two shared libraries to that location and online debugging worked fine then.

Regards,
Eric