I have this upload error :(

Im trying to upload the SD card function for my 3d cnc machine and i keep getting this error (Arduino: 1.8.16 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\User\AppData\Local\Temp\ccp2HOuf.ltrans0.ltrans.o: In function `main':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino Mega or Mega 2560.

Error downloading https://downloads.arduino.cc/packages/package_index.json

Has anyone had this before and if so what was your solution?

you have neither void setup() nor void loop() defined

The code you didn't post doesn't have a setup or loop function.

This is not a boot loader issue

I have checked the entire sketch and nothing obvious is standing out ,Im using marlin for my mega so is there a debug that I can use to show the line of the error ?


@captainusa65 you didn't get the hint;

Please post your code, AFTER reading this;

Please read this link.

This will help with advice on how to present your code and problems.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

For CNC I recommend using this

The PC-software has a firmware-loader included.

  • Connect your board with USB-cable,
  • load firmware
  • done

easy to use for 2,5D and 3D milling

You can test the full functional software for free.
The program uses an increasing delay if you create CNC-files
price is 50€ Which is worth every cent to remove the delay

best regards Stefan