How compiling this component ?

More
23 May 2014 01:31 #47212 by gaston48
Hello everybody !
what is the problem ?
thank you very much



atanxy.comp
component atanxy;

pin out float out;
pin in float in0;
pin in float in1;

function _;
license "GPL";
;;
#include <rtapi_math.h>
#define PI 3.141592653589

FUNCTION(_) { out = atan2 (in0,in1) * 180 / PI }
Attachments:

Please Log in or Create an account to join the conversation.

More
23 May 2014 13:53 #47227 by ArcEye
Hi

FUNCTION(_) { out = atan2 (in0,in1) * 180 / PI }


There is no terminating semicolon after PI

Suspect that is it, parse routine not finding line termination to work on.

regards

Please Log in or Create an account to join the conversation.

More
23 May 2014 15:04 #47232 by gaston48
Hello ArcEye
thank you for your answer
Yes sorry :blush:

but after correcting the problem is the same.
same post after "$ comp atanxy.comp" ??

Please Log in or Create an account to join the conversation.

More
23 May 2014 15:13 #47233 by ArcEye
Hi

I think it is just a case of the python parser not being as good at resolving obfusticated C as cpp

This seems to compile fine
component atanxy;

pin out float out;
pin in float in0;
pin in float in1;

function _;
license "GPL";
;;
#include <rtapi_math.h>
#define PI 3.141592653589

FUNCTION(_) 
{ 
    out = (atan2 (in0,in1) * (180 / PI)); 
}

regards

Please Log in or Create an account to join the conversation.

More
23 May 2014 15:42 #47237 by gaston48
Perfect :) thank you.

This is a precaution I take with Pascal but I do not know C + +
and I did not dare ...

Please Log in or Create an account to join the conversation.

More
23 May 2014 15:58 #47240 by gaston48
Oops, no, the problem is the same :blush: ?
I compile another fichier.comp and it works well ?

Please Log in or Create an account to join the conversation.

More
23 May 2014 16:02 #47241 by ArcEye
I am not using the same version of comp probably and I did not install the component, just built it.

Try comp --compile atanxy.comp

and be sure that the new one is in the path not the old one

regards

Please Log in or Create an account to join the conversation.

More
23 May 2014 16:34 #47243 by gaston48
Thank you for your patience
with my comp :

sincos.comp works well
atanxy.comp no ?

File Attachment:

File Name: sincos.comp
File Size:0 KB

File Attachment:

File Name: atanxy.comp
File Size:0 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
23 May 2014 16:42 #47244 by ArcEye
Hi

I am working on another partition and cannot test just yet

I did notice however that the atanxy.comp is littered with ^M charactors, which I suspect means it has been edited under windows

That in its own can produce an error

Try cutting and pasting the version I posted into gedit and then compile it

regards

Please Log in or Create an account to join the conversation.

More
23 May 2014 17:13 #47245 by gaston48
Yes you're right, this is the problem!

But I wrote my atanxy.comp and my sincos.comp in gedit ??
and in gedit, my atanxy.comp and yours are identhique

(I wonder if I is not a keyboard problem)

Please Log in or Create an account to join the conversation.

Time to create page: 0.102 seconds
Powered by Kunena Forum