1

I use visual Micro for Visual Studio. Out of nowhere, I can't compile for any board. I tried a blink sketch for the nano, and I get intelisense red underlines for simple things like pinMode, digitalWrite, and Serial.print. Here's what I get for an output:

Compiling debug version of 'Nano_Trials' for 'Arduino Nano w/ ATmega328'
Build folder: file:///C:/Users/jf051e/AppData/Local/V.Micro/Arduino/Builds/Nano_Trials/nano_atmega328
Additional Defines: VM_DEBUG;VM_DEBUG_ENABLE 1;VM_DEBUG_BANDWIDTH_THROTTLE_MS 50;VM_DEBUGGER_TYPE_HARDWARESERIAL 0;VM_DEBUGGER_TYPE_SOFTWARESERIAL 1;VM_DEBUGGER_TYPE_FASTSERIAL 2;VM_DEBUGGER_TYPE_USB 3;VM_DEBUGGER_TYPE_TEENSY 4;VM_DEBUGGER_TYPE_UART 5;VM_DEBUGGER_TYPE_USART 6;VM_DEBUGGER_TYPE_USBSERIAL 7;VM_DEBUGGER_TYPE_TTYUART 8;VM_DEBUGGER_TYPE_NET_CONSOLE 9;VM_DEBUGGER_TYPE_Uart 10;VM_DEBUGGER_TYPE_COSA 11;VM_DEBUGGER_TYPE_CDCSerialClass 12;VM_DEBUGGER_TYPE VM_DEBUGGER_TYPE_HARDWARESERIAL;VM_DEBUG_BREAKPAUSE;
Architecture Tools: {runtime.tools.avr-gcc.path}/bin/
Sketchbook: file:\\\C:\Users\jf051e\Documents\Arduino
Sketch Include Paths
Include Path 'C:\Users\jf051e\Documents\Arduino\Nano_Trials'
Core Include Paths
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino'
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs'
Library Include Paths (1)
"{runtime.tools.avr-gcc.path}\bin\avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=106011 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers\VM_DBG" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers" "C:\Users\jf051e\AppData\Local\V.Micro\Arduino\Builds\Nano_Trials\nano_atmega328\Nano_Trials.cpp" -o "nul"
The system cannot find the file specified
    Preprocess: "{runtime.tools.avr-gcc.path}\bin\avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=106011 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers\VM_DBG" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers" "C:\Users\jf051e\AppData\Local\V.Micro\Arduino\Builds\Nano_Trials\nano_atmega328\Nano_Trials.cpp" -o "nul"
Unknown error during deep search source code for includes. Attempting alternative regex exploration
System.NullReferenceException: Object reference not set to an instance of an object.
   at Visual.Micro.MiroAppAPI.SketchCompilerArduino._TryRunPreProcessIncludesDiscoveryUntilDone(String sourceFilePath, Board brd, List`1 includePaths, Boolean isTopLevel)
   at Visual.Micro.MiroAppAPI.SketchCompilerArduino.TryRunPreProcessIncludesDiscoveryUntilDone(String sourceFilePath, Board brd, List`1 includePaths, SketchLibraryList knownLibs)
   at Visual.Micro.MiroAppAPI.SketchCompilerArduino._compile(SketchBuilder lsketch, String primaryClassName, Boolean verbose, Boolean isDebug)
Library Include Paths (1)
Build Core Paths: C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino
Using library VM_DBG version 0.0.0 in folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers\VM_DBG
"{runtime.tools.avr-gcc.path}/bin/avr-g++" -c -g -Os -Wall -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=106011 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers\VM_DBG" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers\VM_DBG" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries" -I"C:\Users\jf051e\Documents\Arduino\libraries" "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers\VM_DBG\VM_DBG.cpp" -o "C:\Users\jf051e\AppData\Local\V.Micro\Arduino\Builds\Nano_Trials\nano_atmega328\VM_DBG\VM_DBG.cpp.o" -DVM_DEBUG -DVM_DEBUG_ENABLE=1 -DVM_DEBUG_BANDWIDTH_THROTTLE_MS=50 -DVM_DEBUGGER_TYPE_HARDWARESERIAL=0 -DVM_DEBUGGER_TYPE_SOFTWARESERIAL=1 -DVM_DEBUGGER_TYPE_FASTSERIAL=2 -DVM_DEBUGGER_TYPE_USB=3 -DVM_DEBUGGER_TYPE_TEENSY=4 -DVM_DEBUGGER_TYPE_UART=5 -DVM_DEBUGGER_TYPE_USART=6 -DVM_DEBUGGER_TYPE_USBSERIAL=7 -DVM_DEBUGGER_TYPE_TTYUART=8 -DVM_DEBUGGER_TYPE_NET_CONSOLE=9 -DVM_DEBUGGER_TYPE_Uart=10 -DVM_DEBUGGER_TYPE_COSA=11 -DVM_DEBUGGER_TYPE_CDCSerialClass=12 -DVM_DEBUGGER_TYPE=VM_DEBUGGER_TYPE_HARDWARESERIAL -DVM_DEBUG_BREAKPAUSE
The system cannot find the file specified
    Process: "{runtime.tools.avr-gcc.path}\bin\avr-g++" -c -g -Os -Wall -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=106011 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers\VM_DBG" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers\VM_DBG" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries" -I"C:\Users\jf051e\Documents\Arduino\libraries" "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\zq2favuv.ley\Micro Platforms\default\debuggers\VM_DBG\VM_DBG.cpp" -o "C:\Users\jf051e\AppData\Local\V.Micro\Arduino\Builds\Nano_Trials\nano_atmega328\VM_DBG\VM_DBG.cpp.o" -DVM_DEBUG -DVM_DEBUG_ENABLE=1 -DVM_DEBUG_BANDWIDTH_THROTTLE_MS=50 -DVM_DEBUGGER_TYPE_HARDWARESERIAL=0 -DVM_DEBUGGER_TYPE_SOFTWARESERIAL=1 -DVM_DEBUGGER_TYPE_FASTSERIAL=2 -DVM_DEBUGGER_TYPE_USB=3 -DVM_DEBUGGER_TYPE_TEENSY=4 -DVM_DEBUGGER_TYPE_UART=5 -DVM_DEBUGGER_TYPE_USART=6 -DVM_DEBUGGER_TYPE_USBSERIAL=7 -DVM_DEBUGGER_TYPE_TTYUART=8 -DVM_DEBUGGER_TYPE_NET_CONSOLE=9 -DVM_DEBUGGER_TYPE_Uart=10 -DVM_DEBUGGER_TYPE_COSA=11 -DVM_DEBUGGER_TYPE_CDCSerialClass=12 -DVM_DEBUGGER_TYPE=VM_DEBUGGER_TYPE_HARDWARESERIAL -DVM_DEBUG_BREAKPAUSE
Error compiling libraries

I swear I didn't touch anything. i was working on a different sketch and when I hit compile, Visual Studio froze and said it was busy. i had to kill the process and try again. I did this like 8 times before i realized that I could do longer compile ANY sketch. I even restarted my PC to no avail. What the heck??

  • Did your trial period run out? – Johnny Mopp Jul 29 '17 at 10:53
2

So I seem to have fixed it. One way or another, I think VisualMicro suffered some type of problem with the installed boards. My first clue was that my sketches still compiled int the native Arduino IDE. So I went into the VisualMicro explorer and noticed that there was an update to 1.6.19 in the board manager (I was running 1.6.13). I don't know exactly what the problem was, but installing the update to 1.6.19 seems to have fixed it.

1

There are a few suggestions here, here and here:

  1. Ensure you are using the latest Arduino software that is compatible with Visual Micro (this is not necessarily the latest Arduino software!)

  2. Go to Visual Micro menu -> Board pulldown -> Find or install a board--> Rescan. You should get "Toolchain reload complete". The Visual Micro forum administrator suggests that you do this twice.

  3. Reset the User's Appdata Arduino folder

    • Close all IDE's

    • Delete the C:\Users\\AppData\Local\Arduino15 folder

    • Start the Arduino IDE once. Close after it has fully started

    • Then try Visual Micro again

  4. Delete the preferences.txt file (if it exists) Goto C:\Users\\AppData\Roaming\Arduino and delete the preferences.txt file.

  5. One user had success with using the Long Path Tool. This has many functions but may fix errors like paths not being accessible or too long.

  • Thanks for the ideas, but none of these worked. I'm still getting errors for basic functions like pinMode(), digitalWrite(), and Serial.print(). It's almost like my standard libraries were corrupted or something. – LegitimateWorkUser Aug 1 '17 at 14:43
  • Hey guys, I seem to have fixed it. I'll edit the post. – LegitimateWorkUser Aug 1 '17 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.