Hey all,
I am not very good at arduino and C, and I'm still new to linux so bear with me.
I'm trying to compile arduino files with a make file on Linux Mint 16. I installed both the arduino-core and arduino-mk packages, and made the following files as a test: (mostly taken from http://www.jayway.com/2011/10/08/arduino-on-ubuntu-without-ide/)
blink.cpp
#include "WProgram.h"
int ledPin = 13; // LED connected to digital pin 13
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH); // set the LED on
delay(500); // wait for half a second
digitalWrite(ledPin, LOW); // set the LED off
delay(500); // wait for half a second
}
int main(void) {
init();
setup();
for (;;) {
loop();
}
}
and
Makefile
NO_CORE = yes
BOARD_TAG = uno
#TARGET = blink
MCU = atmega328p
#F_CPU = 16000000
ARDUINO_PORT= /dev/ttyS0
#AVRDUDE_ARD_BAUDRATE = 115200
#AVRDUDE_ARD_PROGRAMMER = arduino
include /usr/share/arduino/Arduino.mk
However, when I compile from the terminal using "make", I end up getting an error "blink.cpp:1:22: fatal error: WProgram.h: No such file or directory compilation terminated."
If I replace "Wprogram.h" with "Arduino.h"(as suggested by a bunch of people on the internet), I get this error: "In file included from blink.cpp:1:0: /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:213:26: fatal error: pins_arduino.h: No such file or directory."
I am using an Uno on Linux Mint 16 VM (but everything hardware wise is configured correctly, no worries about that). Make reset works perfectly so I know the hardware is configured correctly (although that doesn't really matter since I can't even compile). My guess is missing .c/.cpp files or something along those lines, as it can read the function declarations but not the definitions.
Things I tried:
A lot of suggestions from the internet including copying pins_arduino.h to the cores folder (although I know it's not supposed to work), adding a bunch of stuff to the boards.txt file, and anything else I found. I've been working on this for 3.5 hours and I'm absolutely lost and I need to get it working as soon as possible.
Thank you in advance.