Error compiling for board Arduino Mega or Mega 2560

Error compiling for board Arduino Mega or Mega 2560.

I've tried everything, It doesn't matter what code I use. Can someone help?

Please use “preferences” to switch compiler and uploader error messages to “verbose” and then copy and paste the error messages as “code” into a post.

Also I recommend initially compiling a “new” sketch (ie. an empty sketch). I always do this first after selecting a board type which I haven’t used previously.

After confirming this works the next thing I do is to compile the standard “blink” sketch and then confirm this gets properly uploaded to the target board and that the LED blinks as it should.

1 Like

Usually this kind of message comes up when the wrong board has been chosen from the "boards manager" menu.

It should read like this

image

But maybe that is too simple ... :wink:

1 Like

The correct board was selected and it still said the error compiling board for Arduino Mega ......

Hi @daphmaster3000. Please do as electricboyo requested and provide the verbose compilation output.

I'll provide detailed instructions you can follow:


:exclamation: NOTE: These instructions will not solve the problem. They are only intended to gather more information which might provide a clue that eventually leads to a solution.


  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the box next to "Show verbose output during: ☐ compilation".
  3. Click the OK button.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. After the compilation fails you'll see a button on the right side of the orange bar in Arduino IDE: Copy error messages. Click that button.
    This copies the full output to the clipboard.
  6. Open a forum reply here by clicking the Reply button.
  7. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  8. Press Ctrl+V.
    This will paste the compilation output into the code block.
  9. Move the cursor outside of the code tags before you add any additional text to your reply.
  10. Click the Reply button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the Reply button.
  5. Click the "Upload" icon (image) on the post composer toolbar:
    Upload icon on toolbar
  6. Select the .txt file you saved.
  7. Click the Open button.
  8. Click the Reply button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

G:\My Drive\arduino\ARDUINO 1\Arduino\arduino-builder -dump-prefs -logger=machine -hardware G:\My Drive\arduino\ARDUINO 1\Arduino\hardware -hardware C:\Users\seren\AppData\Local\Arduino15\packages -tools G:\My Drive\arduino\ARDUINO 1\Arduino\tools-builder -tools G:\My Drive\arduino\ARDUINO 1\Arduino\hardware\tools\avr -tools C:\Users\seren\AppData\Local\Arduino15\packages -built-in-libraries G:\My Drive\arduino\ARDUINO 1\Arduino\libraries -libraries G:\My Drive\arduino\ARDUINO 1\Arduino\libraries\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0000_0000 -ide-version=10819 -build-path C:\Users\seren\AppData\Local\Temp\arduino_build_176611 -warnings=none -build-cache C:\Users\seren\AppData\Local\Temp\arduino_cache_580950 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=G:\My Drive\arduino\ARDUINO 1\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=G:\My Drive\arduino\ARDUINO 1\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=G:\My Drive\arduino\ARDUINO 1\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=G:\My Drive\arduino\ARDUINO 1\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=G:\My Drive\arduino\ARDUINO 1\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=G:\My Drive\arduino\ARDUINO 1\Arduino\hardware\tools\avr -verbose C:\Users\seren\AppData\Local\Temp\arduino_modified_sketch_820988\p06_LightTheremin.ino
loading hardware from C:\Users\seren\AppData\Local\Arduino15\packages: following possible symlink C:\Users\seren\AppData\Local\Arduino15\packages: Access is denied.

Error compiling for board Arduino Mega or Mega 2560.

Do you have any idea of why Arduino IDE might be encountering a "symlink" while scanning this folder @daphmaster3000?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.