CANopenNode / CANopenSocket

Obsolete repository, replaced by CANopenDemo and CANopenLinux
Apache License 2.0
208 stars 119 forks source link

make failed #26

Closed glalit15 closed 3 years ago

glalit15 commented 3 years ago

So I am new to CANopen and wanted to run the examples/basicDevice but when I enter make, I am getting an error

../../CANopenNode/socketCAN/CO_main_basic.c:28:30: fatal error: bits/getopt_core.h: No such file or directory

after this I tried to make in the CANopenNode respository and getting the same error as well. (I am running this on Ubuntu Mate)

P.S. I already have a hardware CAN Bus where I am reading the data from a sensor by ESP32 and sending it over CAN to a Linux system. Now I want to implement CANopen on this WhatsApp Image 2021-03-19 at 14 07 45

CANopenNode commented 3 years ago

Just remove unnecessary line with #include <bits/getopt_core.h>. (#include should be enough.) I fixed CANopenNode.

spaceKelan commented 1 year ago

I experienced the same problem with the CANopenDemo framework when trying to compile cocomm. I had to comment that line out and additionally add the CFLAG -std=gnu99 because with -std=c99 it would complain. Error because <bits/getopt_core.h> not found image resolved by commenting line out as recommended by @CANopenNode

Trying to make after commented library out image

Added -std=c99 flag to the makefile image

make image

Instead of -std=c99 flag, -std=gnu99 flag is added to the makefile image

make image

and the executable is build image

Hope this helps people on the same journey :)