Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to include a library file?: (6 Items)
   
How to include a library file?  
Hi,

I am working on a Momentics IDE 4.5v trial version on Windows XP machine.
This is connected to my QNX target system 6.4.0v trial version.
I have a library file named as "SusiCore.so", This i got it from Vendor.
This library was not developed using QNX RTOS.

I placed the library files in the following path of Windows machine.
C:/QNX640/target/qnx6/x86/lib/SusiCore.so

I followed the following steps to include the Library files.

1.) I went to the properties of the project->linkers->Category(Extra Library paths)->Obsolute path is given in the 
window.

2.) Properties of the project->linkers->Category(Extra Object files)->Added the library files.

3.) I was able to build it sucessfully.

4.) When i tried to run the project, its giving the error as "Could not load library C:/QNX640/target/qnx6/x86/lib/
SusiCore.so"

5.) Please find the attached screen shot of my project.



Regards,
Vijay.

Attachment: Bitmap 3.bmp 1.6 MB
Re: How to include a library file?  
Hi,

You also need to have the shared library on your target.

Either copy the lib directly onto the target, e.g. using the Target Filesystem Navigator, and put it into a directory 
named in the LD_LIBRARY_PATH - e.g., /lib.

Or, open the run dialog, select your launch configuration, go to the "Upload" tab, check "Upload shared libraries to the
 target" and press "Add..." to select and add your shared library. It will then be transferred to the target 
automatically every time you run your program.

- Thomas
Re: How to include a library file?  
Hi,

Using the launch configuration, i tried to upload the shared libraries.

But still i am facing with the same error.

Also i loaded the library files directly on to the Target system "/lib" folder.

I am getting the same error.

"Could not load library C:/QNX640/target/qnx6/x86/lib/SusiCore.so"


Regards,
Vijay.
 
Re: How to include a library file?  
Looks like name of the library hardcoded as C:/QNX640/target/qnx6/x86/lib/SusiCore.so it should be just SusiCode.so
It has to be compiled for qnx neutrino. Can you open Properties view in IDE and select you library in Project Explorer. 
Properties view should
have "name" field. What is the value in there? Also check you binary, in the same view. What is in needed section?

vijay kumar wrote:
> Hi,
> 
> Using the launch configuration, i tried to upload the shared libraries.
> 
> But still i am facing with the same error.
> 
> Also i loaded the library files directly on to the Target system "/lib" folder.
> 
> I am getting the same error.
> 
> "Could not load library C:/QNX640/target/qnx6/x86/lib/SusiCore.so"
> 
> 
> Regards,
> Vijay.
>  
> 
> 
> _______________________________________________
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post31332
> 
Re: How to include a library file?  
Hi,

As you said, 
1. I removed the obsolute path, and given only the library file name as SusiCore.so
2. Then we pasted the library files in the project folder. 
3. I bulid the project, the files are got loaded into project explorer.
4. Navigated to properties view , selected library file- in that name filed - "SusiCore.so"
5. I runned the code, but still it says "Could not load library C:/QNX640/target/qnx6/x86/lib/SusiCore.so".
6. I have attached the screen shot of the settings what i have done.



Attachment: Image screen shot.JPG 117.19 KB
Re: How to include a library file?  
Looks like "needed" is wrong it should not list full path.
You can run from target yourself to exclude IDE problems, I am pretty sure you will get same error (transfer binary and 
library in /tmp folder using Target File System Navigator),
telnet to a target and launch from /tmp.

vijay kumar wrote:
> Hi,
> 
> As you said, 
> 1. I removed the obsolute path, and given only the library file name as SusiCore.so
> 2. Then we pasted the library files in the project folder. 
> 3. I bulid the project, the files are got loaded into project explorer.
> 4. Navigated to properties view , selected library file- in that name filed - "SusiCore.so"
> 5. I runned the code, but still it says "Could not load library C:/QNX640/target/qnx6/x86/lib/SusiCore.so".
> 6. I have attached the screen shot of the settings what i have done.
> 
> 
> 
> 
> 
> _______________________________________________
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post31376
> 
> 
> ------------------------------------------------------------------------
>