To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1403
1402  |  1404
Subject: 
Re: Linking failure when 'making' an lx file
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 28 Aug 2000 23:04:12 GMT
Viewed: 
1084 times
  
In lugnet.robotics.rcx.legos, Colin Ryan writes:
/usr/local/crossgcc/h8300-hitachi-hms/bin/h8300-hitachi-hms-ld -T
../boot/legOS.lds -relax -L/home/ryancd/legOS/lib nanOrb.o  -lc -lmint -lfloat
-lc++ -o nanOrb.ds1 -Ttext 0xb000
nanOrb.o(.text+0xcc):nanOrb.c: undefined reference to `___ucmpsi2'
nanOrb.o(.text+0xcc):nanOrb.c: undefined reference to `___ucmpsi2'
make: *** [nanOrb.ds1] Error 1

Sorry about the extra stuff, the linking problem was due to the compiler
trying to find the above link "___ucmpsi2". When I used h8300-hitachi-hms-nm
I could see all the methods and links in my code, and this was the only strange
looking one. I tracked it down to a single line of code that was along the
lines of ;
if(unsigned_long_var1 - unsigned_long_var2) > sizeof(unsigned char)) .....

By evaluating both sides of the '>' seperatly and assigning the results to
variables, before testing the '>' between these two variables, the problem
miraculously disappeared .....strange I know ...

i.e

unsigned long foo = (unsigned_long_var1 - unsigned_long_var2);
unsigned long foo2 = sizeof(unsigned char);
if(foo > foo2) ...

Does this mean that the compiler is failing whilst trying to optimise the
code ? I'm still very new to C/C++ so I'd appreciate any information or
possible explanation of this .....still learning ;-)

Colin



Message has 1 Reply:
  Re: Linking failure when 'making' an lx file
 
(...) Syntax error: you are missing a parenthesis at the start, right after the if. But gcc should give a fat error at the ">" sign I believe. if( COND ) STATEMENT; if( (ul_var1 - ul_var2) > sizeof(uchar)) STATEMENT; (...) It is miraculous that the (...) (23 years ago, 25-Mar-01, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Linking failure when 'making' an lx file
 
Hi Can anyone tell me why I'm getting a linking failure when trying to compile my C code, in the standard way. The linker is failing to find a fucntion I have defined in my source: /usr/local/crossgcc/...chi-hms-ld -T ../boot/legOS.lds -relax (...) (24 years ago, 28-Aug-00, to lugnet.robotics.rcx.legos)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR