Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - How to link .a lib in momentics? - Newbie question: (4 Items)
   
How to link .a lib in momentics? - Newbie question  
Hi all,

I have a simple question:  How to link a static lib(.a) in Momentics?  I built liballeg.a on my VM X86 target which is 
running Nutrino 6.5.  I have created a QNX project using my Momentics SDP 6.5.  I am trying to link the liballeg.a to 
hello world program that I am writing to draw a circle. 

In Momentics IDE, I added alleg to the projects->properties->linker->extralibraries, but I still  keep getting the 
following error:
C:/QNX650/target/qnx6/x86/lib -L C:/QNX650/target/qnx6/x86/usr/lib  -Wl,--rpath-link . -Wl,--rpath-link C:/QNX650/target
/qnx6/x86/lib -Wl,--rpath-link C:/QNX650/target/qnx6/x86/usr/lib    -lgf    -limg    -Bstatic    -lalleg    -Bdynamic   
-g     
C:\QNX650\host\win32\x86\usr\bin\ntox86-ld: cannot find -lalleg
cc: C:/QNX650/host/win32/x86/usr/bin/ntox86-ld caught signal 1

I do have liballeg.a installed in /lib directory of my target!

I would appreciate if anyone can help me with question.

Regards,

Reza.
RE: How to link .a lib in momentics? - Newbie question  
In the same linker tab, select "Extra library paths" and add "/lib".

-----Original Message-----
From: Reza Salehi [mailto:community-noreply@qnx.com] 
Sent: May-20-11 1:59 PM
To: general-ide
Subject: How to link .a lib in momentics? - Newbie question

Hi all,

I have a simple question:  How to link a static lib(.a) in Momentics?  I
built liballeg.a on my VM X86 target which is running Nutrino 6.5.  I
have created a QNX project using my Momentics SDP 6.5.  I am trying to
link the liballeg.a to hello world program that I am writing to draw a
circle. 

In Momentics IDE, I added alleg to the
projects->properties->linker->extralibraries, but I still  keep getting
the following error:
C:/QNX650/target/qnx6/x86/lib -L C:/QNX650/target/qnx6/x86/usr/lib
-Wl,--rpath-link . -Wl,--rpath-link C:/QNX650/target/qnx6/x86/lib
-Wl,--rpath-link C:/QNX650/target/qnx6/x86/usr/lib    -lgf    -limg
-Bstatic    -lalleg    -Bdynamic   -g     
C:\QNX650\host\win32\x86\usr\bin\ntox86-ld: cannot find -lalleg
cc: C:/QNX650/host/win32/x86/usr/bin/ntox86-ld caught signal 1

I do have liballeg.a installed in /lib directory of my target!

I would appreciate if anyone can help me with question.

Regards,

Reza.



_______________________________________________

General
http://community.qnx.com/sf/go/post86017
Re: How to link .a lib in momentics? - Newbie question  
Hi Andy,

Thanks for the quick reply.  However, when you said /lib, do you mean on the host system or the target system?  I think 
the Extra Library Path is pointing to the host system - am I correct.  If so, can I do the following:

1.  Build my library (.a) on the target system.
2.  Copy the library to somewhere on the host system disk.
3.  Add an Extra Library Path entry to point to number #2 above.
4.  Add the .h file for the library to the project in the IDE.
5. Compile and build.

Thanks,

Reza.
RE: How to link .a lib in momentics? - Newbie question  
Yes IDE only looks for your library on your host development system not
on your target system. You mentioned "/lib" I thought you meant on your
host system.

It doesn't matter where you build your library (.a) as long as it's a
Neutrino binary and can be linked with your executable. Your steps seems
to be right - don't forget to add that library name to the "Extra
Libraries" section.

-----Original Message-----
From: Reza Salehi [mailto:community-noreply@qnx.com] 
Sent: May-20-11 2:35 PM
To: general-ide
Subject: Re: How to link .a lib in momentics? - Newbie question

Hi Andy,

Thanks for the quick reply.  However, when you said /lib, do you mean on
the host system or the target system?  I think the Extra Library Path is
pointing to the host system - am I correct.  If so, can I do the
following:

1.  Build my library (.a) on the target system.
2.  Copy the library to somewhere on the host system disk.
3.  Add an Extra Library Path entry to point to number #2 above.
4.  Add the .h file for the library to the project in the IDE.
5. Compile and build.

Thanks,

Reza.