sudar / Arduino-Makefile

Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.
http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile
GNU Lesser General Public License v2.1
2.01k stars 449 forks source link

undefined reference to setup / loop #547

Open achu1431 opened 6 years ago

achu1431 commented 6 years ago

` New Text Document (3).txt ov7670.h.txt

./opt/arduino-builder/arduino-builder` -compile -core-api-version 10611 -build-path /tmp/266865351/build -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -libraries /tmp/266865351/pinned -libraries /tmp/266865351/custom -fqbn arduino:avr:uno -build-cache /tmp -logger humantags -verbose=false /tmp/266865351/sketch_jan24a

/tmp/ccGoZPWp.ltrans0.ltrans.o: In function `main':

/home/admin/builder/opt/cores/arduino/avr/cores/arduino/main.cpp:43: undefined reference to `setup'

/home/admin/builder/opt/cores/arduino/avr/cores/arduino/main.cpp:46: undefined reference to `loop'

collect2: error: ld returned 1 exit status

exit status 1

achu1431 commented 6 years ago

could'nt find the solution for long time..pls help me frnds,,,tnx in advance

sudar commented 6 years ago

@achu1431

Can you post your full makefile and source file?

sej7278 commented 6 years ago

if he's calling arduino-builder he's not even using the makefile. he may have just confused issue #370

i seem to recall some old problem where you can't have your own main()