Error compiling for board

Hello all,

Having some issues trying to compile and upload a simple online sketch. Not sure what the issue is, drivers were installed on the pc, com port is good yet im getting

"Error compiling for board Arduino/Genuino Mega or Mega 2560" can anyone help solve this rudimentary issue?

Here is the error code in verbose setting as directed by a similar thread

Code as follows:

Arduino: 1.8.10 (Windows XP), Board: “Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)”

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Documents and Settings\Administrator\Local Settings\Application Data\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Documents and Settings\Administrator\Local Settings\Application Data\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Documents and Settings\Administrator\My Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0010 -ide-version=10810 -build-path C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\arduino_build_193287 -warnings=none -build-cache C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\arduino_cache_546688 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Documents and Settings\Administrator\Local Settings\Application Data\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Documents and Settings\Administrator\Local Settings\Application Data\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Documents and Settings\Administrator\My Documents\Arduino\Relay Sketch\relay_sketch\relay_sketch.ino
panic: Failed to find GetFileInformationByHandleEx procedure in kernel32.dll: The specified procedure could not be found.

goroutine 1 [running]:
syscall.(*LazyProc).mustFind(0x130459e0)
/home/jenkins/go1.12.5/src/syscall/dll_windows.go:311 +0x42
syscall.(*LazyProc).Addr(0x130459e0, 0xdda500)
/home/jenkins/go1.12.5/src/syscall/dll_windows.go:318 +0x21
internal/syscall/windows.GetFileInformationByHandleEx(0x718, 0x9, 0x13075a04, 0x8, 0x3, 0x1301d348)
/home/jenkins/go1.12.5/src/internal/syscall/windows/zsyscall_windows.go:353 +0x27
os.newFileStatFromGetFileInformationByHandle(0x1305aaf0, 0x42, 0x718, 0x0, 0x1305aaf0, 0x42)
/home/jenkins/go1.12.5/src/os/types_windows.go:52 +0x135
os.(*File).Stat(0x13042ee0, 0x984490, 0x13042ee0, 0x0, 0x13042ee0)
/home/jenkins/go1.12.5/src/os/stat_windows.go:55 +0x133
io/ioutil.ReadFile(0x1305aaf0, 0x42, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/jenkins/go1.12.5/src/io/ioutil/ioutil.go:62 +0xac
github.com/arduino/go-paths-helper.(*Path).ReadFile(…
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/go-paths-helper/paths.go:407
[github.com/arduino/arduino-cli/arduino/cores/packageindex.LoadIndex(0x13042ed8](http://github.com/arduino/arduino-cli/arduino/cores/packageindex.LoadIndex(0x13042ed8), 0xa29e60, 0x13051da0, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/arduino/cores/packageindex/index.go:205 +0x2f
[github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).LoadPackageIndexFromFile(0x13104c20](http://github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).LoadPackageIndexFromFile(0x13104c20), 0x13042ed8, 0x0, 0x0, 0x13042ed8)
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/arduino/cores/packagemanager/package_manager.go:202 +0x25
[github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).loadPlatforms(0x13104c20](http://github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).loadPlatforms(0x13104c20), 0x130975f0, 0x13042e18, 0x7, 0x1304cac8)
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/arduino/cores/packagemanager/loader.go:186 +0xf4d
[github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).LoadHardwareFromDirectory(0x13104c20](http://github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).LoadHardwareFromDirectory(0x13104c20), 0x13042bf8, 0xdda500, 0x703815)
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/arduino/cores/packagemanager/loader.go:116 +0x43f
[github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).LoadHardwareFromDirectories(0x13104c20](http://github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).LoadHardwareFromDirectories(0x13104c20), 0x13042c00, 0x2, 0x2, 0x1, 0x1)
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/arduino/cores/packagemanager/loader.go:52 +0x4f
[github.com/arduino/arduino-cli/legacy/builder.(*HardwareLoader).Run(0xdebc68](http://github.com/arduino/arduino-cli/legacy/builder.(*HardwareLoader).Run(0xdebc68), 0x130e65a0, 0xdebc68, 0x0)
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/legacy/builder/hardware_loader.go:43 +0xe4
[github.com/arduino/arduino-cli/legacy/builder.(*ContainerSetupHardwareToolsLibsSketchAndProps).Run(0xdebc68](http://github.com/arduino/arduino-cli/legacy/builder.(*ContainerSetupHardwareToolsLibsSketchAndProps).Run(0xdebc68), 0x130e65a0, 0xdebc68, 0xdda500)
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/legacy/builder/container_setup.go:60 +0x266
[github.com/arduino/arduino-cli/legacy/builder.runCommands(0x130e65a0](http://github.com/arduino/arduino-cli/legacy/builder.runCommands(0x130e65a0), 0x13075f0c, 0x2, 0x2, 0xffffff01, 0x0, 0x4)
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/legacy/builder/builder.go:210 +0xbd
[github.com/arduino/arduino-cli/legacy/builder.(*ParseHardwareAndDumpBuildProperties).Run(0x13075f40](http://github.com/arduino/arduino-cli/legacy/builder.(*ParseHardwareAndDumpBuildProperties).Run(0x13075f40), 0x130e65a0, 0xdebbb4, 0x13042c98)
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/legacy/builder/builder.go:198 +0xbc
github.com/arduino/arduino-cli/legacy/builder.RunParseHardwareAndDumpBuildProperties(…
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-cli/legacy/builder/builder.go:231
main.main()
/home/jenkins/workspace/arduino-builder-all-cross-cli-inception/src/github.com/arduino/arduino-builder/main.go:388 +0x772
C:\Program Files (x86)\Arduino\arduino-builder returned 2

Error compiling for board Arduino Mega or Mega 2560.

Thanx trying that now

Ok now im getting an error uploading the code. Its a simole blinky sketch from a successful source. Post exceeds 9000 characters uploading in plain text file

Trying again

Notes_201128_034652.txt (15.1 KB)

Notes_201128_034652.txt (15.1 KB)

From [member=1473560]s1lv3r0n3[/member]'s Notes_201128_034652.txt:
Arduino: 1.8.9 (Windows XP), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

...

Using board 'mega' from platform in folder: C:\Documents and Settings\Administrator\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.8.3
Using core 'arduino' from platform in folder: C:\Documents and Settings\Administrator\Local Settings\Application Data\Arduino15\packages\arduino\hardware\avr\1.8.3

...

Sketch uses 1448 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
java.io.IOException: Cannot run program "___REMOVE___/bin/avrdude": CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
    at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
    at cc.arduino.packages.uploaders.SerialUploader.runCommand(SerialUploader.java:383)
    at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:197)
    at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
    at processing.app.SketchController.upload(SketchController.java:732)
    at processing.app.SketchController.exportApplet(SketchController.java:703)
    at processing.app.Editor$UploadHandler.run(Editor.java:2070)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
    at java.lang.ProcessImpl.start(ProcessImpl.java:137)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 9 more

This Cannot run program "___REMOVE___/bin/avrdude" error indicates something has gone wrong with the copy of the Arduino AVR Boards platform of your Mega that was installed via Boards Manager. The solution is to remove the installed platform, which will cause the version of Arduino AVR Boards bundled with your Arduino IDE installation to be used. Be aware this will remove any boards you have installed via Boards Manager:

  • (In the Arduino IDE) File > Preferences
  • Click the link on the line following “More preferences can be edited directly in the file”. This will open the C:\Documents and Settings\Administrator\Local Settings\Application Data\Arduino15 folder.
  • Delete the “packages\arduino” subfolder. Please be very careful when deleting things from your computer. When in doubt, back up!
  • Restart the Arduino IDE

Verify that you can now upload to your Mega.

If it is then fixed, you’ll know there was some problem with the installation of Arduino AVR Boards 1.8.3. It may be that this was a transient glitch that will not reoccur on another attempt to install Arduino AVR Boards. There’s also a possibility that there is some fundamental incompatibility between the modern Arduino AVR Boards version and Windows XP, in which case the problem will come back when you install Arduino AVR Boards 1.8.3 again. If the latter, the solution would be to repeat the process I described above and then refrain from updating Arduino AVR Boards again. While it’s nice to use the latest version, I think the older version of Arduino AVR Boards that is bundled with Arduino IDE 1.8.9 will work just fine for you.

Thanks for the help, i have to work on getting a new pc if im going to do any more arduino stuff

It is unfortunate that the march of progress in software leaves behind a lot of perfectly good hardware. A couple years ago, Arduino actually made some laudable efforts to regain support for XP after was inadvertently lost, even though most of the industry had long since stopped supporting XP at that point. But this time around, the support was broken by the Golang programming language the Arduino builder tool is written in, leaving Arduino with no possibility of continuing to support XP.

But those old versions of the Arduino IDE, Arduino AVR Boards, and other boards platforms that work fine with XP are still available. Even though there have been some improvements made since that time, many thousands of people happily used those older version with XP, and they should work well enough for you. So if an XP machine is all that is available to you, don’t let that hold you back from progressing with Arduino.