Hmm.

I think I am already doing that.  Here are my CFLAGS and LDFLAGS from my
make file:

CFLAGS = -lm -g -O -Wall -DMAIN -I. -I/home/bse/elinux/dist/usr/include
-D$(PCx_ARCH) -DKR_headers

LDFLAGS = -nodefaultlibs -Wl,-rpath,/home/bse/elinux/dist/lib
-L/home/bse/elinux/dist/lib -L/home/bse/elinux/dist/usr/lib -lc -lgcc -lm

The snippet of code that does not work is as follows:
 do {
   buf[--i] = (value%base) + '0';
   value /= base;
 }

where "buf" is a static char array, "value" is a long and "base" is an
int.

Am I even allowed to mix ints and longs like this?  I should admit that
this code is not mine;  I'm just trying to compile it.  ;)  It works fine
with gcc ... just not arm-linux-gcc.

Thanks very much,

Philip Ferguson
Massachusetts Institute of Technology
Space Systems Lab


On Mon, 12 Mar 2001, Tomasz Motylewski wrote:

> On Mon, 12 Mar 2001, Philip Andrew Ferguson wrote:
>
> > For some reason, I cannot use the mod (%) or div (/) functions.  I always
> > get an error at compile time saying that there were undefined references
> > to "__modsi3" and "__divsi3".
>
> You can try to link it with libgcc.a (locate it).
> On i86 one can get such problem when dividing "long long" (8
> byte) integers.
>
> --
> Tomek
>
>


_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.

Reply via email to