Arduino make file throwing an error

Hi there!

I am attempting to use the arduino make file to compile my project on my raspberry pi. The project compiles just fine on the IDE, but throws the following errors when i try to compile it using the make file:
error: ‘class String’ has no member named ‘toFloat’
error: ‘class EEPROMClass’ has no member named ‘put’
error: ‘class EEPROMClass’ has no member named ‘get’

Im like :o . It almost seems like the make version is some older version thats totally missing those functions. I even attempted to copy the missing toFloat function from my windows WString.cpp(not sure if this is the correct file) file found in

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\WString.cpp over to the pi, in the same file, but it was a no go. I think once I make a change, i'd have to recompile it?

It just seems too much of a hassle just to get the make file to compile my project like the IDE does so easily.

Am I missing something here? Why is it even using different library files than the Arduino to compile??

I know this is a super lame question, but any pointers would be super helpful. I am totally out of ideas :((

Best,
Uber

Post a link to where you got this makefile thing from. Please use the chainlinks icon on the toolbar to make the link clickable.

Hi!

Thank you for the swift reply! super amazing.

So I simply got it from apt-get install arduino-mk. Followed the following video:

Best,
Uber

uberJoker754:
The project compiles just fine on the IDE

Is that IDE on your RPi, or on your Windows computer?

Both. The project compiles on the Pi and windows when I use the Arduino IDE.

The version of the Arduino IDE that is installed via apt-get is extremely outdated, and would cause those errors. So I suspect what happened is you either did an apt-get install arduino or else arduino-mk has it as a dependency and did that for you when you installed it. There are some variables that tell arduino-mk the location of the Arduino installation:

You can set those as environment variables or edit the makefile to change the default values (which are currently pointing to that outdated Arduino IDE installation).

I would also go ahead and remove that outdated IDE installation so there is no chance of it causing you problems in the future. You should be able to do that via apt-get remove arduino.

my Makefile looks like this:

ARDUINO_DIR = /usr/share/arduino
ARDUINO_PORT = /dev/ttyAM*

USER_LIB_PATH = /home/pi/sketchbook/libraries
BOARD_TAG = uno

include /usr/share/arduino/Arduino.mk

the version of my IDE(unless im confused what an IDE means. I clicked Help and about to check this), is 1.8.7. That's even higher than my windows machine.

Am I missing some path here?

Best,
Uber

uberJoker754:
the version of my IDE(unless im confused what an IDE means. I clicked Help and about to check this), is 1.8.7. That's even higher than my windows machine.

About the Arduino IDE: https://www.arduino.cc/en/Guide/Environment. Although arduino-mk doesn't use the GUI part of the Arduino IDE, it does use files that are installed with the Arduino IDE. Try running /usr/share/arduino/arduino to make sure that one is Arduino IDE 1.8.7.

Thank you for your help!

Problem is solved. I was actually pointing to the wrong directory(as you correctly pointed out). My ARDUINO_DIR for version 1.8.7 was actually located in the Downloads folder. Just fixing that made everything work!

Best,
Uber

You're welcome. I'm glad to hear it's working now. Enjoy!
Per