Sketch works in Windows not Linux

I'm a total newbie trying to learn. If something I type here doesn't make sense it's because I have a limited understanding of what I'm doing to this point.

So my subject/topic statement about a sketch has me a bit confused.

I installed Arduino 2.02 on a Windows 10 laptop and proceeded to install the library from here:

So far all the examples seem to work fine on the Windows 10 laptop.

I also have Arduino 2.02 on my Linux Mint 20.3 desktop computer with the same library installed.

When I try to download the same sketch from the examples in Linux I get a compilation error.

For example if I send the example sketch send_Blink from Linux Mint I get an error:

Blockquote

Compilation error: no matching function for call to 'mcp2515_can::sendMsgBuf(int, int, int, unsigned char [8]'

Blockquote

Both installs were new and both only have the Seeed_Arduino_CAN Library added from the same link.

Why would it work in Windows but not in Linux?

I'd suspect an incorrect library or missing header...

The rest of the message should tell you it's invocation point.

:smiley_cat:

Thanks for taking the time to reply. I appreciate it.

I don't understand how it could be an incorrect library or missing header when I'm using the exact same link to download the exact same library? The only difference I see is one computer is Windows and one is Linux...

Please post the entire error message, using code tags.

There can be errors due to the sketch code or the library using an incorrect header file name.
i.e. using "Foo.h" when the real name is "foo.h"
that will work on Windows but not on linux even though the code is using the incorrect file name.

Post the full error so we can see the issue.

--- bill

Please forgive my ignorance but I am not sure how to use code tags. This whole programming thing is new to me. I read the message when I tried to post last time but I still think I did it wrong. I'll try again...

Here is the error when I try the example send_recieve that works fine in Windows:

/tmp/.arduinoIDE-unsaved20221025-37144-16gdp88.sn79/send_receive/send_receive.ino:52:41: error: no matching function for call to 'mcp2518fd::sendMsgBuf(int, int, int, unsigned char [8])'
     CAN_SEND.sendMsgBuf(0x00, 0, 8, stmp);
                                         ^
In file included from /tmp/.arduinoIDE-unsaved20221025-37144-16gdp88.sn79/send_receive/send_receive.ino:6:0:
/home/paul/Arduino/libraries/Seeed_Arduino_CAN-master/src/mcp2518fd_can.h:153:16: note: candidate: virtual byte mcp2518fd::sendMsgBuf(byte, long unsigned int, byte, byte, byte, const volatile byte*)
   virtual byte sendMsgBuf(byte status, unsigned long id, byte ext, byte rtr,
                ^~~~~~~~~~
/home/paul/Arduino/libraries/Seeed_Arduino_CAN-master/src/mcp2518fd_can.h:153:16: note:   candidate expects 6 arguments, 4 provided
/home/paul/Arduino/libraries/Seeed_Arduino_CAN-master/src/mcp2518fd_can.h:155:16: note: candidate: virtual byte mcp2518fd::sendMsgBuf(long unsigned int, byte, byte, byte, const byte*, bool)
   virtual byte sendMsgBuf(unsigned long id, byte ext, byte rtr, byte dlc,
                ^~~~~~~~~~
/home/paul/Arduino/libraries/Seeed_Arduino_CAN-master/src/mcp2518fd_can.h:155:16: note:   candidate expects 6 arguments, 4 provided

exit status 1

Compilation error: no matching function for call to 'mcp2518fd::sendMsgBuf(int, int, int, unsigned char [8])'

Now that I re-read the error is it possible that the line

/home/paul/Arduino/libraries/Seeed_Arduino_CAN-master/src/mcp2518fd_can.h:153:16: note:   candidate expects 6 arguments, 4 provided

is this my problem?

When YOU CD to that directory, do you see mpc2518fd_can.h in the file finder/explorer?

Yes. As it turns out providing two more arguments to that line in the sketch allows it to compile and run in Linux. Thanks for the help.

This issue with the code seems similar, although I'm not sure why Windows would work .
https://github.com/Seeed-Studio/Seeed_Arduino_CAN/issues/137

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.