View topic - IDE debugging problem with dynamic library

IDE debugging problem with dynamic library

anything that doesn't fit to other groups.

IDE debugging problem with dynamic library

Postby Ericxx » Tue May 04, 2010 12:42 pm

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
Ericxx
Senior Member
 
Posts: 158
Joined: Mon Jun 09, 2008 1:38 pm

RE: IDE debugging problem with dynamic library

Postby maschoen » Tue May 04, 2010 2:54 pm

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
maschoen
QNX Master
 
Posts: 2715
Joined: Wed Jun 25, 2003 5:18 pm

RE: IDE debugging problem with dynamic library

Postby Ericxx » Tue May 04, 2010 2:59 pm

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
Ericxx
Senior Member
 
Posts: 158
Joined: Mon Jun 09, 2008 1:38 pm

RE: IDE debugging problem with dynamic library

Postby mario » Tue May 04, 2010 3:09 pm

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.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: IDE debugging problem with dynamic library

Postby maschoen » Tue May 04, 2010 4:05 pm

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
maschoen
QNX Master
 
Posts: 2715
Joined: Wed Jun 25, 2003 5:18 pm

RE: IDE debugging problem with dynamic library

Postby Ericxx » Tue May 04, 2010 4:34 pm

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
Ericxx
Senior Member
 
Posts: 158
Joined: Mon Jun 09, 2008 1:38 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 3 guests