# Detecting libraries used... Error compiling for board Arduino Nano

i have been using arduino ide for about 2 years now and for the last year i can only compile ANY sketch once. if i had an error and i fix it and click compile again, just about as fast as i can click it i get

``````C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\19189\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10813 -build-path C:\Users\19189\AppData\Local\Temp\arduino_build_408195 -warnings=all -build-cache C:\Users\19189\AppData\Local\Temp\arduino_cache_237915 -prefs=build.warn_data_percentage=85 -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 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -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 -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\19189\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10813 -build-path C:\Users\19189\AppData\Local\Temp\arduino_build_408195 -warnings=all -build-cache C:\Users\19189\AppData\Local\Temp\arduino_cache_237915 -prefs=build.warn_data_percentage=85 -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 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -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 -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
Using board 'nano' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
Error compiling for board Arduino Nano.
``````

so as you can imagine trying to learn how to code and dealing with this problem has been serious hell.. i have searched and searched and the only thing i have found is to uninstall with Revounistaller and make sure all files are removed ,, which i have done at the very least 20 times( no joke)
the work around i have been using with the nano (mine is new bootloader) if im not sure if its going to compile ill start with Nano (old bootloader) and if it compiles i change it to Nano option and hit upload. and no issues..
so if i have errors i fix the errors change the board option hit compile if i have another code issue i fix it change the board option hit compile if i have anpther issue i fix it change the board option.... as you can imagine trying to learn how to code and dealing with this is hell.. so if i dont change the board option after a compile or failed compile i get the attached msg instantly and that is with all compiler warnings..
i have even tried deleting everything starting a new account on my computer and reinstalling with the same results..

hopefully i was clear with everything, i have been dealing with this for about a year and its driving me insane, and my blood pressure through the roof haha

screen record

josjlandon:
i can only compile ANY sketch once.

This indicates the problem is related to the compilation caching mechanism. On the first compile, the full program is compiled. After that, to make compilation faster, only the sketch and any other parts of the program (e.g., libraries) that have changed are compiled.

When I don't have a clear explanation of strange behavior during the compilation process, I often like to blame the antivirus. To see if it is the culprit, you can try TEMPORARILY disabling your antivirus for a single compilation to see if the problem goes away, then turn the antivirus back on. If the problem doesn't occur with the antivirus off you will need to adjust the settings of your antivirus to whitelist the appropriate file, folder, or process so it doesn't interfere with compilation.

Please be cautious about working without an antivirus. This is only about temporarily disabling it for a quick test. If you don't feel comfortable doing that, fine. You can try going straight to configuring the antivirus to whitelist the Arduino software.

I have a couple other things to suggest if that doesn't work out.

Hi Folks,
I have the same issue. Compiling the first time after starting the IDE works, the second time works not anymore.
Errormessage:
Arduino: 1.8.13 (Windows 10), Board: "Arduino Due (Programming Port)"
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Bernie\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Bernie\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Bernie\Documents\Arduino\libraries -fqbn=arduino:sam:arduino_due_x_dbg -vid-pid=2341_003D -ide-version=10813 -build-path C:\Users\Bernie\AppData\Local\Temp\arduino_build_491212 -warnings=all -build-cache C:\Users\Bernie\AppData\Local\Temp\arduino_cache_203000 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino -verbose C:\Users\Bernie\Documents\Arduino\Arduino_Due_TX 0.14.1\Arduino_Due_TX\Arduino_Due_TX.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Bernie\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Bernie\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Bernie\Documents\Arduino\libraries -fqbn=arduino:sam:arduino_due_x_dbg -vid-pid=2341_003D -ide-version=10813 -build-path C:\Users\Bernie\AppData\Local\Temp\arduino_build_491212 -warnings=all -build-cache C:\Users\Bernie\AppData\Local\Temp\arduino_cache_203000 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.arm-none-eabi-gcc-4.8.3-2014q1.path=C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino -prefs=runtime.tools.bossac-1.6.1-arduino.path=C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.6.1-arduino -verbose C:\Users\Bernie\Documents\Arduino\Arduino_Due_TX 0.14.1\Arduino_Due_TX\Arduino_Due_TX.ino
Using board 'arduino_due_x_dbg' from platform in folder: C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12
Using core 'arduino' from platform in folder: C:\Users\Bernie\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12
Detecting libraries used...
Error compiling for board Arduino Due (Programming Port).

But just on the second try to compile. The Board, the USP-Port and as well the Code dosen't matter. Every second try to compile the same story. I switched off the Firewall and the Realtime Scanner as well. This changed nothing.

Need help!

Bernie

Hi Folks,
no one with an Idea?

Bernie.

Try this:

1. Select File > Preferences from the Arduino IDE's menus.
2. Click the link at the line following "More preferences can be edited directly in the file". This will open the `C:\Users\Bernie\AppData\Local\Arduino15` folder (or something similar for those using another OS).
3. Open the `preferences.txt` file in a text editor.
4. Close all Arduino IDE windows.
5. Add the following line to the `preferences.txt` file:
``````compiler.cache_core=false
``````
6. Save the `preferences.txt` file.
7. Start the Arduino IDE.
8. Try compiling twice again.

NOTE: These instructions are specific to Arduino IDE 1.x. They are not applicable for those who are using Arduino IDE 2.x.

1 Like

Done.
Nothing changed. The second try to compile fails.
Bernie

i disabled antivirus and still have the issue..
i changed compiler.cache_core=true to compiler.cache_core=false
still having issues with compile

1 Like

still nothing?? nobody? lol

https://forum.arduino.cc/index.php?topic=688338.0

that is the reason i have uninstalled and reinstalled so many times,,, but it hasnt worked..

(If you're looking for a procedure available to fix this, just skip this.)
Hi everyone. After I've been here, I realized that it wasn't just me.
Firstly, I thought it was something wrong in my computer like a runtime or so. However, after my effort to install several all-in-one runtime, nothing turns better.
So, that's it. Hoping for official team to fix this bug.

the only "fix" i have found so far is to downgrade to 1.8.9
well worth it to me because that was a ridiculous headache

Okay. I'll (have to) give it a try.

For days I've been handling something complex and finally squeeze some time to do this.

Hopefully, it does worked.

Your hint did the trick for me on following system:
Raspberry 3
Operating System: Raspbian GNU/Linux 10
KDE Plasma Version: 5.14.5
Qt Version: 5.11.3
KDE Frameworks Version: 5.54.0
Kernel Version: 5.10.17-v7+
OS Type: 32-bit
Processors: 4 × ARMv7 Processor rev 4 (v7l)
Memory: 924.2 MiB of RAM
Actually I did not append the line at the end, I modified line 9 of preferences.text.
After the first try the system froze, but after reboot the next one was successful.
Yesterday I have spent a whole day trying to modify path information in the header-files. It was useless: after each path was working new errors (type-definitions) appeared.
So I reinstalled the libc6 files and tried your idea. Thank you very much.
Mike

Hello guys,
maybe mike_ban_pho solved it, but I see different OS (Raspbian), no Win10.

I have same problem on corporate PC with Windows 10, where is Admin centrally managed. I run Arduino IDE, compilation works and code loading works. But when I change something, second attempt doesnt work "Libraries are used". Then when I exit Arduino IDE app and run it again, compile works just for once.

Maybe it is some shit with OneDrive (sync), Azure, or other Microsoft things used by Cyber security teams that making developer's work bad and worse each month. For example we have
OneDrive synced directories C:\Users(me)... .
Once you change something here, it is being sync somewhere sometimes in next seconds,minutes,hours. Maybe at this time when you try compile Arduino IDE, then cache files and libraries are used by sync process.

Can somebody of you report this issue to Arduino IDE development team, to fix it ?

Kriss

1 Like

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