Long divides, shifts, etc. need code from the startup library. I usually
just copy this code from the startup library sources into my project (since
long ago I had some problem lining the startup library to a shared library
project. Sorry I have forgotten the exact problem, I just do it that way
from the start now)
-----Original Message-----
From: Ariel Barreiro [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 28, 1999 17:25
To: Palm Forum List
Subject: Desesperately need help. Shared library weird error
Hello everybody,
I have been trying to learn the basis of shared libraris and when I almost
beleived that I have made it I found a heck of a mistake.
Lets take my problem to the sample lib project from 3com or even to the
sample lib project from Jeff Ishaq, the fellow who wrote a great article
about shared libraries. Both projects compiled good. Without any error. Even
they work fine.
Now I add a two sipmle lines to any function in my shared library (I did
this for testing, couse it was hard to find the exact reason of my problem)
For example, I will use the sample lib project code:
Err SampleLibDrawRectangle(UInt refNum, DWord clientContext, Int x, Int y,
Int width, Int height) {
Err err = 0;
Int cornerDiam; // corner diameter
RectangleType r; // rectangle
==> unsigned long a,b,c; // Added by me
==> a = b / c; /// Added by me
( ...........)
Here goes the rest of the code, but thats not important.
( ...........)
return( 0 );
}
Those (the unsigned long declaration and the division) was the only lines I
added to a project that compiled quite fine. When I recompiled it i get the
followin error
Link Error : SampleLib.c: '__ldivu__' referenced from
'SampleLibDrawRectangle' is undefined.
Please, if anybody has any idea of this I would apreciate it a lot.
What I realized or guess is that the compiler is calling a dividing function
due to the / opperand and some how, who knows why, the compiler coudn't
found the fucntion. I went around with some linker options but without any
success.
NOTE: It is also not working with * (multiplication)
Ariel
Buenos Aires, Argentina, SouthAmerica.