#9136 - slip - Tue Jul 29, 2003 4:02 am
I downloaded the SWI library by Andrew P. Bilyk, I link with the following command:
g++ -o main.elf *.o -lm swi(iwram).lib
I've included swi.h and I get "undefined reference to which ever function I try to call.
Can someone tell me whats going on?
thanks
_________________
[url="http://www.ice-d.com"]www.ice-d.com[/url]
#9150 - slip - Tue Jul 29, 2003 12:01 pm
My objects arn't being compiled with -mthumb-interwork and I don't get a warning, when trying to link. But I tried compiling my objects with -mthumb-interwork then I get warnings. I also tried adding -mlong-calls, but I still get undefined reference to the function I'm trying to call. All my sources include the swi.h file and I've got the defines there.
any ideas?
_________________
[url="http://www.ice-d.com"]www.ice-d.com[/url]
#9153 - slip - Tue Jul 29, 2003 2:16 pm
You know I haddn't seen the extern "C" {} thing until just last week, I'd never used it before but now I've used it twice on the same project... lol oh well, what works works right? That sorta fixed the problem thanks =). I can now make the calls, but I still get a whole heap of warnings about .o files not being interworking. I've also compiled everything again with -mthumb-interwork. I also changed the library I was using from iwram to text, when trying to link the iwram one I got relocation error, but just now when I tried again I didn't get it. Though now my program seems to stop when making a call to SWI_ArcTan2 using iwram, =\... odd.
I have a Question about ArcTan and ArcTan2. In school we use artan, is arctan and artan the same thing, artan short for arctan? I though I heard that somewhere. If thats the case, then whats the number format for the inputs, I can understand that ArcTan2 could take x and y and perform a y/x then find the ar(c?)tan. But how is ArcTan suposed to work with just a single signed integer?
For example I'm testing ArcTan2 using 9 as my x and 4 as my y, I'm assuming what I said before... ar(c?)tan(y/x). So on my trusty old calculator I put in 4/9 = 0.444444444444, I get the artan of that which in degrees is 23.96248897, in radians its 0.418224329 and in gradients its 26.62498775. Unless my Integer display routine isn't working right I get a result of 4362, which is not any of the above, I thought it might be a fixed point number but by shifting left by 8 I get 17.0390625 and if I shift by 7 I get 34.078125, which you can see is not 23 degrees.
In the case of just ArcTan, how are you supposed to input 0.44444444444? Is it supposed to be a fixed point number?
Or have I got all this wrong? If I do, has anyone got any ideas about how I can calculate the ar(c?)tan of an angle?
Thanks again guys
EDIT: Ok I spoke to my Maths Teacher and Artan is the same as Arctan.
_________________
[url="http://www.ice-d.com"]www.ice-d.com[/url]