OpenEtherCATsociety / SOEM

Simple Open Source EtherCAT Master
Other
1.35k stars 686 forks source link

Error during tutorial #833

Closed sigurdrb closed 4 months ago

sigurdrb commented 4 months ago

Hi. I don't know if this is the right place to ask. Please delete the post if not.

I have tried to follow the tutorial in the documentation, but I got these errors:

error: implicit declaration of function ‘rprintp’; did you mean ‘dprintf’? [-Werror=implicit-function-declaration] 256 | rprintp("SOEM (Simple Open EtherCAT Master)\nSimple test\n"); | ^~~ | dprintf /home/sigurdrb/SOEM/test/discovery/discovery.c:257:4: error: implicit declaration of function ‘task_spawn’ [-Werror=implicit-function-declaration] 257 | task_spawn ("simpletest", simpletest, 9, 8192, NULL); | ^~~~~~ cc1: all warnings being treated as errors make[2]: [test/discovery/CMakeFiles/discovery.dir/build.make:76: test/discovery/CMakeFiles/discovery.dir/discovery.c.o] Error 1 make[1]: [CMakeFiles/Makefile2:302: test/discovery/CMakeFiles/discovery.dir/all] Error 2 make: *** [Makefile:136: all] Error 2

I managed to get the simple_test.c up and running, and modifying it with the cmake/ make commands. But I could not use the rprintp and task_spawn commands as in the tutorial. I tried to build a standalone test file, or include the lines in the int main of the simple_test.c file that I managed to get up and running.

Sorry for the dumb question, but I didn't know where to post this question. My guess is that it is something elementary in the build that I'm missing.

nakarlsson commented 4 months ago

It is sample code, replace it with the same functions provided by our platform.

It is not rocket science, rprintf would be replaced by printf….

sigurdrb commented 4 months ago

Thanks for the reply. Ok, it wasnt obvious to me that this wasnt some functions not related to the library. I tried to look the functions up but got no hits. I will replace them and see if it works.