Error when compiling kinematics

More
06 Apr 2022 20:36 #239472 by LearningLinuxCNC
Good day,

I am compiling a kinematics module for a custom machine that has only B axis modifications to the kinematics. I am basing the kinematics module off of maxkins.c.

when compiling using
sudo halcompile --install xyzb-kins.c

I get an error. The error is in  /usr/include/linuxcnc/rtapi.h:734:5 which is included in the xyzb-kins.c file.

the error is:
error: expected ‘,’ or ‘;’ before ‘char’
     char rtapi_exported_##x[] = #x;

The code in the file at this location is:
#define EXPORT_SYMBOL(x) __attribute__((section(".rtapi_export"))) \
    char rtapi_exported_##x[] = #x;
#define EXPORT_SYMBOL_GPL(x) __attribute__((section(".rtapi_export"))) \
    char rtapi_exported_##x[] = #x;

What is the correct fix for this situation?

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

More
07 Apr 2022 22:21 #239601 by andypugh
Which kernel are you uisng? I see that section of code in rtapi.h is wrapped in some ifdef statements.

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

More
08 Apr 2022 11:31 #239651 by LearningLinuxCNC
Andy,

uname -r returns

4.19.0-11-rt-amd64

This is installed from the 2.8.0 iso

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

More
09 Apr 2022 22:14 #239778 by andypugh
The syntax is something I am unfamiliar with, but:
gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html
suggests that attribute(( something)) is valid.

Is there any chance that you have introduced a windows-style line ending so that the continuation character is not being parsed properly?

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

More
10 Apr 2022 22:22 #239866 by LearningLinuxCNC
I don't think so. I did not actually modify this file at all. That is the same syntax and the file was downloaded directly from the linuxcnc repository. I did not change it prior to the error showing up. This is strange indeed. I will try to download the file again and replace it.

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

More
11 Apr 2022 19:34 #239961 by LearningLinuxCNC
The problem was not actually in rtapi.h
It was in the xyzb-kins.c file.
Compiling realtime xyzb-kins.c
xyzb-kins.c:89:1: warning: data definition has no type or storage class
 KINS_NOT_SWITCHABLE
 ^~~~~~~~~~~~~~~~~~~
xyzb-kins.c:89:1: warning: type defaults to ‘int’ in declaration of ‘KINS_NOT_SWITCHABLE’ [-Wimplicit-int]

Thanks for your assistance Andy.

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

More
03 Sep 2022 08:21 #251086 by LAUSCH
Hi,

Can you provide the solution to the problem? So what did you change in the code in order to make it run?

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

More
03 Sep 2022 12:32 #251102 by LearningLinuxCNC
The error in the file is that shown in the post above.

I did not need or use KINS_NOT_SWITCHABLE so this was the solution.
/*KINS_NOT_SWITCHABLE*/
The following user(s) said Thank You: LAUSCH

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

Time to create page: 0.094 seconds
Powered by Kunena Forum