The Arduino IDE will not compile any sketches if the IDE is run with standard (i.e. non-admin) privileges, even if the IDE is installed using the downloadable ZIP file (i.e. for standard users). Compiling all sketches, include the BareMinimum sketch, generates an error message that the header file 'stdlib.h' cannot be found. The work around solution is to run the IDE with full administrative priviledges.
Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Uno"
In file included from sketch\BareMinimum.ino.cpp:1:0:
F:\temp\t1\arduino-1.6.8\hardware\arduino\avr\cores\arduino/Arduino.h:23:20: fatal error: stdlib.h: No such file or directory
#include <stdlib.h>
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
My system information
OS Name Microsoft Windows 10 Pro
Version 10.0.16299 Build 16299
Other OS Description Not Available
OS Manufacturer Microsoft Corporation
System Name WIN10PROX64
System Manufacturer To be filled by O.E.M.
System Model To be filled by O.E.M.
System Type x64-based PC
System SKU To be filled by O.E.M.
Processor AMD Phenom(tm) II X6 1045T Processor, 2700 Mhz, 6 Core(s), 6 Logical Processor(s)
BIOS Version/Date American Megatrends Inc. 0901, 24-Nov-11
SMBIOS Version 2.7
Embedded Controller Version 255.255
BIOS Mode UEFI
BaseBoard Manufacturer ASUSTeK COMPUTER INC.
BaseBoard Model Not Available
BaseBoard Name Base Board
Platform Role Desktop
Secure Boot State Unsupported
PCR7 Configuration Binding Not Possible
Windows Directory C:\WINDOWS
System Directory C:\WINDOWS\system32
Boot Device \Device\HarddiskVolume4
Locale United States
Hardware Abstraction Layer Version = "10.0.16299.192"
User Name WIN10PROX64\Ian Bell
Time Zone Eastern Standard Time
Installed Physical Memory (RAM) 16.0 GB
Total Physical Memory 16.0 GB
Available Physical Memory 10.2 GB
Total Virtual Memory 18.3 GB
Available Virtual Memory 10.9 GB
Page File Space 2.38 GB
Page File C:\pagefile.sys
Virtualization-based security Not enabled
Device Encryption Support Reasons for failed automatic device encryption: TPM is not usable, PCR7 binding is not supported, Hardware Security Test Interface failed and device is not InstantGo, Un-allowed DMA capable bus/device(s) detected, TPM is not usable
Hyper-V - VM Monitor Mode Extensions Yes
Hyper-V - Second Level Address Translation Extensions Yes
Hyper-V - Virtualization Enabled in Firmware Yes
Hyper-V - Data Execution Protection Yes
1.6.8 was a shitshow. My notes say it was unusable (1.6.5r5, 1.6.9, and 1.6.12 are the good 1.6.x versions - but all the 1.8.x versions are usable. 1.6.x was a very poorly managed set of releases; very few were released without significant regressions).
Use the current version, not that old thing, and see if it works.
The problem also occurrs with with V1.8.4 and V1.8.5 of the IDE. The 1.8 versions I tested all take over a minute to load whereas V1.6.13 version loads almost immediately. That is why I uninstalled V1.8 and re-installed V1.6.13. I just started learning/working with an Arduino Uno and the IDE. My understanding is it makes no much difference which IDE version I use to work through the tutorials, at least the introductory ones.
My understanding is that when the Anduino IDE attempts to compile the sketch, the compiler is unable to find the standard C header file 'stdlib.h'. The path for this file is: C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\stdlib.h
As this file does exist, the problem is the IDE is unable find it when compiling with standard privileges. In contrast, the IDE can successfully find this file when compiling with full administrative privileges. In my experience, this suggests this is an IDE configuration problem. However, I see nothing in the IDE preference settings that allow me to specify which paths it uses to locate header files (as does Visual Studio).
I do not understand how my internet security program (Kaspersky) or HyperV would effect the IDE's ability to locate a file. Having said that, I actually disabled Kaspersky for testing purposes and this did not resolve the problem.
It has been known for some AV to intercept components during compilation etc. (After all you are writing code)
Some even try to keep paths / registry keys etc safe by various sandbox type features.
Hence the suggestion to turn it off to test although I dont remember Kaspersky being one of the culprits.
Hyper V does not really give much benefit unless you are actually using it with VM's etc.
It also cased various misc serial issues when I used it from my server as there is not enough serial support in HV.
A route that has been shown to work is a simple re-install.
However my own preference for that is to do a thorough clean up BEFORE that.
And again my own pref is to do this as a full administrator with the AV OFF although not always required.
Attaching some clean up suggestions that have worked for many others.
I have only recently started working with the Anduino Uno but have already spent just over a day trying to resolve this problem. I've just completed an internet search and, as it has not been reported before, it is quite possible this problem is unique to my system and may not be resolved without considerably more effort.
On the bright side, I have a work around solution (i.e. working with full admin privileges) so this problem is not a 'show stopper'. I will resume learning more about the Aduino and set aside time at a later date to look into this problem.
Once again, it was good of you to respond so quickly and offer your assistance.
I copied the ZIP contents to a drive/directory where a standard user account has both read/write privileges. The IDE generated the same error message about not being able to find the header file.
If it works with FULL ADMIN permissions then it would indicate a possible policy or restriction on the profile that does not work.
Although some say you never need proper administrative privileges it has been shown time and again to fix some issues.
It could also indicate a small corruption of that users profile.
If you know what you are doing it is worth looking at both the users profile and maybe doing a clone (windows has the ability to do that) or checking what restrictions are affecting that user.
AV has been seen to affect user rights in regards to program installations and such and sometimes using that users profile but installing the IDE "AS ADMINISTRATOR" can often fix the problem.