- Configuring LinuxCNC
- Advanced Configuration
- [SOLVED] "syntax error in VERSION script" compiling kins with Halcompile.
[SOLVED] "syntax error in VERSION script" compiling kins with Halcompile.
- andypugh
-
Topic Author
- Offline
- Moderator
-
Less
More
- Posts: 19678
- Thank you received: 4557
01 Nov 2025 13:21 #337652
by andypugh
[SOLVED] "syntax error in VERSION script" compiling kins with Halcompile. was created by andypugh
I have found a solution to the problem often seen when trying to compile Kinematics (or occasionally other) modules from C-code with halcompile.
Solution:
Make sure that the .c file contains the following code and the problem should be solved.
This requires the file to supply an app_main and exit:
Explanation
Halcompile creates a Makefile to compile the component. This includes Makefile.modinc
Makefile.modinc contains this code:
Which is what creates the modulename.ver file that the complaint is about. Without #include "rtapi_app.h" the .rtapi_export section doesn't exist, so the .ver file is invalid.
Adding the header is enough to complile the module, but it will then fail to load without an rtapi_app_main()
Solution:
Make sure that the .c file contains the following code and the problem should be solved.
#include "rtapi_app.h"This requires the file to supply an app_main and exit:
int comp_id;
int rtapi_app_main(void) {
comp_id = hal_init("bipodkins");
hal_ready(comp_id);
return comp_id;
}
void rtapi_app_exit(void)
{
hal_exit(comp_id);
}Explanation
Halcompile creates a Makefile to compile the component. This includes Makefile.modinc
Makefile.modinc contains this code:
$(Q)objdump -w -j .rtapi_export -t $*.tmp \
| awk 'BEGIN{print "{ global :"} /rtapi_exported_/{printf("%s;\n", substr($$6,16))} END{print "local : * ; };"}' \
> $*.verWhich is what creates the modulename.ver file that the complaint is about. Without #include "rtapi_app.h" the .rtapi_export section doesn't exist, so the .ver file is invalid.
Adding the header is enough to complile the module, but it will then fail to load without an rtapi_app_main()
The following user(s) said Thank You: tommylight, rodw, unknown
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4556
- Thank you received: 2029
02 Nov 2025 07:11 #337695
by Aciera
Replied by Aciera on topic [SOLVED] "syntax error in VERSION script" compiling kins with Halcompile.
Thanks for figuring that out!
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- [SOLVED] "syntax error in VERSION script" compiling kins with Halcompile.
Time to create page: 0.112 seconds