I have upgraded my mac to Monterey.
Before I upgraded everything worked, including the very sketch I am compiling to test the hardware, but that is what every computer user always says.
Now the arduino IDE can't verify/compile a sketch because
"In file included from /var/folders/kl/571lbk8s45bc19wlv80q8qdh0000gq/T/arduino_build_400306/sketch/ultrasound_distance.ino.cpp:1:0:
/Users/xxxx/Library/Arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/Arduino.h:23:10: fatal error: stdlib.h: No such file or directory #include <stdlib.h>"
I have tried-
reading the post from a year ago with the same issue but the link in the answer is broken.
Installed the final version of ide-1.8.19
copied and pasted a massively commented version of sodlib.h into bbedit and saved the file as stdlib.h. I tried to compile it with the ide but got the same error.
I figure the files must be compiled because searching for *.h gets me no results so no folder for all the library files. I can't use library manager, and trying to trick it by zipping it up results in the ide reporting the zip does not contain a library.
Can anyone tell me how to fix this?
Please don't suggest "restore your mac to when it worked with Arduino" as I have already considered this nuclear option.
Ta
OK I sorted it by pasting the sodlib.h file into the folder in which Finder could not find the library files.
So I now get the next missing library warning from the ide.
Neither stdlib.h nor _mingw.h return any hits in the library manager.
So there is a giant block of libraries missing (stdlib was the second I encountered).
Installing a newer version of the ide over the current version does not add the missing libraries, and neither _mingw nor sodlib occur in the directory the other xxx.h files are in when I look at a backup of a version that compiled the script.
Is there a full library repository that has the libraries that "should have been installed" with the application?
I am not a programmer but I can cheat my way round a computer if I get some clues, so a clue would be helpful.
Ta
Fritigern
stdlib.h is part of the C compiler, not an Arduino library. It should show up in a place like
/Applications/Arduino/Contents/Java/hardware/tools/avr/avr/include/stdlib.h
Or .../packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/avr/include/stdlib.h (
(which I can't imagine being disturbed by a MacOS upgrade, but then... Apple!)
I'm assuming "sodlib.h" is a typo? Never heard of it!
_mingw is a windows thing, it shouldn't be relevant on your mac.
Could you turn on "verbose messages" for compilation in your Arduino preferences and post the full output of your compilation attempt? I want to see which location it is running the compiler from.
(also, please delete any stdlib.h files that you added anywhere else! It's possible that you've added an incompatible stdlib.h in a place that the Arduino compiler finds it, instead of the one is should be using.)
I checked, on a non-"portable" install, if you've updated the AVR core, your avr compiler will be off in a per-user directory. If that somehow got damaged, it might not be replaced just be installing a new IDE.
Thank you.
I spent seven hours on this yesterday and am continuing today.
I have now done a fresh install of Arduino 2.0.1. It seemed to stop being a beta during the evening. Or Safari is opening old page versions.
Anyroadup, with 2,0.1 I still can't compile the sketch, it needs winsock2.h, which seems to me to be a windows file. It was called by _mingw.h- one of the "missing libraries at the start of this waste of time, which I copied to bbedit and put in the directory. If that file is calling windows files, it is suspect, so my stdlib.h may also be a Windows one (sodlib.h was a typo). I think I might delete the Arduino structures in both Applications and my User library and restore from a backup that predates yesterday then reinstall the 2.0.1. IDE.
I'll report back
Fritigern