Getting Arduino compiler erros
Hi I've been trying to program my arduino uno with this Makefile: Code:
#! /usr/bin/make
C_OPTS=-I ./include
CC=avr-gcc $(C_OPTS)
CMP=$(CC) -c $^-o $@
CMB=$(CC) $^ -o $@
upload: main
avrdude $^
main: arm.cpp
$(CMB)
and the following program:
Code:
void setup()
{
pinMode(3, OUTPUT);
}
void loop()
{
digitalWrite(3, HIGH);
}
It worked fine with the compile automagically defining everything on windows, yet I keep getting this error:
Code:
avr-gcc -I ./include arm.cpp -o main
arm.cpp: In function 'void setup()':
arm.cpp:4:13: error: 'OUTPUT' was not declared in this scope
arm.cpp:4:19: error: 'pinMode' was not declared in this scope
arm.cpp: In function 'void loop()':
arm.cpp:9:18: error: 'HIGH' was not declared in this scope
arm.cpp:9:22: error: 'digitalWrite' was not declared in this scope
make: *** [main] Error 1
shell returned 2