Forum Topic - Error while linking new libraries using ntox86-ld: (10 Items)
   
Error while linking new libraries using ntox86-ld  
Hi All,

wer are facing a problem while linking new libraries into our image using the linker ntox86-ld.

We have included the library path using the option "-L ......./qnx/qnx640/target/qnx6/x86/lib
" which has the libstdc++.so in it. And we are invoking the library inclusion with option -lstdc++ in the make options 
and the error message received is 
"ntox86-ld: cannot find -lstdc++"

Please let me know if any of you faced the same problem and fixed it successfully.

Thanks in Advance for your time,
Tapasee


Re: Error while linking new libraries using ntox86-ld  
On 14-06-17 06:35 AM, Tapasee R G Ch wrote:
> Hi All,
>
> wer are facing a problem while linking new libraries into our image using the linker ntox86-ld.
>
> We have included the library path using the option "-L ......./qnx/qnx640/target/qnx6/x86/lib
> " which has the libstdc++.so in it. And we are invoking the library inclusion with option -lstdc++ in the make options
 and the error message received is
> "ntox86-ld: cannot find -lstdc++"
>
> Please let me know if any of you faced the same problem and fixed it successfully.

If you're using the linker directly, you should be add 
-L$QNX_TARGET/x86/lib/gcc/4.2.4/ which has the symlink libstdc++.so to 
../../libstdc++.so.6.

Regards,

Ryan Mansfield

Re: Error while linking new libraries using ntox86-ld  
Thanks Ryan for your inputs. I will try this.

Thanks
Tapasee
Re: Error while linking new libraries using ntox86-ld  
Update:

Hi Ryan,

We use static linking and it looks for libstdc++.a file. We can see that its missing from the standard 
library(QNX_TARGET/x86/lib). Please let me know how I can get libstdc++.a file for QNX 6.4.0.

Thanks in Advance,
Tapasee
Re: Error while linking new libraries using ntox86-ld  
On 14-06-23 02:13 AM, Tapasee R G Ch wrote:
> Update:
>
> Hi Ryan,
>
> We use static linking and it looks for libstdc++.a file. We can see that its missing from the standard 
library(QNX_TARGET/x86/lib). Please let me know how I can get libstdc++.a file for QNX 6.4.0.

As I previously mentioned, add -L$QNX_TARGET/x86/lib/gcc/<gcc version> 
when linking. There's a libstdc++.a in there. I assumed your gcc version 
was 4.2.4 since you mentioned you were using QNX 6.4.0

Regards,

Ryan Mansfield

Re: Error while linking new libraries using ntox86-ld  
Hi Ryan,

Thanks for the update, after adding  -L$QNX_TARGET/x86/lib/gcc/4.2.4 the issue is solved but now we are getting a new 
error

"undefined reference to `_Unwind_Resume'"

Please suggest how we can solve this issue.

Thanks in advance

Regards,
Nikshay
Re: Error while linking new libraries using ntox86-ld  
On 14-06-23 01:46 PM, Nikshay Shrivastava wrote:
> Hi Ryan,
>
> Thanks for the update, after adding  -L$QNX_TARGET/x86/lib/gcc/4.2.4 the issue is solved but now we are getting a new 
error
>
> "undefined reference to `_Unwind_Resume'"
>
> Please suggest how we can solve this issue.

Link in libgcc. It will be in 
$QNX_HOST/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.2.4/libgcc.a.

If you link with the gcc drivers then you don't have to add these paths, 
and implicit libs as driver handles it for you. This is why linking 
directly with ld is not recommended.

Regards,

Ryan Mansfield
Re: Error while linking new libraries using ntox86-ld  
Hi Ryan,

From the linker output I can see we are already linking libgcc.a

Here is the linker flags that we are using 

LDFLAGS+= -no-warn-mismatch -m i386nto -verbose \
                    -L $(QNX_TARGET)/x86/lib \
                    -L $(QNX_HOST)/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.2.4 \
                    -L $(QNX_TARGET)/usr/lib \
                    -L $(QNX_TARGET)/lib/gcc/4.2.4 \
                    -L $(QNX_TARGET)/x86/lib/gcc/4.2.4 \
                    -lc -ltcl84 -lsocket -lm -lc -lgcc -lc -lirc_s -lstdc++

Regards,
Nikshay
Re: Error while linking new libraries using ntox86-ld  
But you're linking statically. You'd need to link ljbgcc again after libstdc++ to resolve any undefined references to 
ljbgcc functions. Or use the --start-group,--end-group options to have the linker have a second pass to resolve the 
dependencies.



  Original Message
From: Nikshay Shrivastava
Sent: Monday, June 23, 2014 9:41 PM
To: sdpprereleases-community
Reply To: sdpprereleases-community@community.qnx.com
Subject: Re: Error while linking new libraries using ntox86-ld


Hi Ryan,

From the linker output I can see we are already linking libgcc.a

Here is the linker flags that we are using

LDFLAGS+= -no-warn-mismatch -m i386nto -verbose \
                    -L $(QNX_TARGET)/x86/lib \
                    -L $(QNX_HOST)/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.2.4 \
                    -L $(QNX_TARGET)/usr/lib \
                    -L $(QNX_TARGET)/lib/gcc/4.2.4 \
                    -L $(QNX_TARGET)/x86/lib/gcc/4.2.4 \
                    -lc -ltcl84 -lsocket -lm -lc -lgcc -lc -lirc_s -lstdc++

Regards,
Nikshay




_______________________________________________

QNX Software Development Platform Pre-Releases
http://community.qnx.com/sf/go/post110833
To cancel your subscription to this discussion, please e-mail sdpprereleases-community-unsubscribe@community.qnx.com
Re: Error while linking new libraries using ntox86-ld  
Hi Ryan,

The issue is solved after linking the library in this order

-lstdc++ -lgcc -lc

Many thanks for your help!!!

Regards,
Nikshay