help finding library{SOLVED}

Hi all

I am a relative newbie, but I do have a modicum of C++ familiarity. but I often fail to find the library that someone else has used.

Recently I came across a sketch in which the first line is :-

#include util/atomic.h

Now util is not the name of the "standard" arduino library .

My search for either the "util" library led to many specific "util" libraries, none of which is similar to any other, and whats more do not have the header file atomic.h in any of them.

Seraching for just atomic.h led me into completely unfamiliar territory. A request to the originator of the sketch has produced no response so far.

Can any of you 'guru' types please help ?

Thanks

util is a default AVR library folder that comes with Arduino. No need to download :slight_smile:

septillion:
util is a default AVR library folder that comes with Arduino. No need to download :slight_smile:

It is also a subdirectory of many libraries, where utility source and header files are placed - ones that are typically not to be included directly in a sketch.

So, just knowing that a header file is in a util directory is not sufficient information.

Knowing why the sketch included that header file is necessary.

Alright, let's rephrase.

atomic.h is part of the default AVR util library. No need to download it.

Alright, let's rephrase.

atomic.h is part of the default AVR util library.

THAT I'll buy.

Thanks to both PaulS and Septillion.
As I said I am a newbie, and I do not know what "fricking code tags" are.
I also do not know Why one needs a statement like "#include util/atomic.h" if atomic.h is part of the default util library.
I have IDE version 1.6.5. When I look at the library manager, I do not see any util or utils library, either as installed or in the all" listing... Does it mean it is not installed or am I on the wrong track?

I am just trying to learn, I know that experts like Septillion get impatient with newbies.
If I am in the wrong forum, please tell me where I should go.

Thanks again

Arvk:
I do not know what "fricking code tags" are.

That statement wasn't specifically directed to you. It's just septillion's signature. It appears at the bottom of every one of their posts. However, you should definitely learn what code tags are and how to use them. Please read the How to use this forum post.

Arvk:
I also do not know Why one needs a statement like "#include util/atomic.h" if atomic.h is part of the default util library.

The same reason that you would include any file, to make the functions of that file available in your sketch.

Arvk:
When I look at the library manager, I do not see any util or utils library, either as installed or in the all" listing... Does it mean it is not installed or am I on the wrong track?

atomic.h and a number of other files are included with the Arduino compiler for your selected board. These files don't show up with the standard libraries in Library Manager but they are still available for you to include. You don't need to install them. If you do want to find the location of this file it's a bit difficult because it could be in different locations depending on which hardware package version you're using. If you're using Arduino AVR Boards and you haven't updated the version using Boards Manager then it will be located at {Arduino IDE installation folder}/hardware/tools/avr/avr/include/util/atomic.h. If you've done an update using Boards Manager or you are using a different hardware core then it may be located in the Arduino15 folder instead. Multiple hardware packages may also use the same tools. The easiest way to find it is to do File > Preferences > Show verbose output during > compilation(check) and then examine the contents of the console window after a compile to find the location of the compiler, then do a search of the tool folder containing the compiler.

Thank you very much Pert.

I think you have given me excellent guidance. I am happy to close this thread if I know how.

Arvk:
Thanks to both PaulS and Septillion.
As I said I am a newbie, and I do not know what "fricking code tags" are.

Fricking code tags are explained in the sticky posts at the top of this subform. It is best that newbies read those stickies.

Arvk:
I also do not know Why one needs a statement like "#include util/atomic.h" if atomic.h is part of the default util library.

The arduino programming environment comes with certain common libraries allready installed by default. However, the C++ compiler does not trawl the library directories for include files and shove all of them into every file it compiles. You have to say which ones you want. The exception is your .ino file. As a convenience, the .ino file is treated as if you had put "#include <Arduino.h>" at the top. Arduino.h itself includes other things, but evidently not util/atomic.h .

Arvk:
I am happy to close this thread if I know how.

That's actually in that "How to use this forum" post:

If you consider the issue solved, please edit your original post (the first one in the thread) and add "[solved]" to the subject line. That helps people know the issue is resolved. Also please post the solution, whether you worked it out yourself, or if someone else helped you. A note that "this was solved by doing X" is very helpful to other people with the same problem. Thanks!

Hello all
Thanks to everybody for their patience with me and very useful guidance much appreciated.

I just like to make some comments for what they are worth.
I indulge in playing with Raspberry Pi, Arduino and Maxi-Mini-Mite micro-controllers. Maybe I am taking on too much. There is endless documentation available on all these, and many persons far cleverer than me have contributed fascinating work.

I have been through 8085, Z-80, 6502(commodore-64 et all), hand assembling machine code ; then Basic, C, Sh. bash(unix,linux),shell scripts.erl/CGI and smattering of HTML. My 77-year brain is overloaded but I try to keep up with ever-growing wealth of technology.

I do try to read all before posting a question, but cannot hold everything in memory (my brain). Have to rely on searching for what I want at a given time. If my words in the search phrase are not quite correct, the results are not what I want.
I resort to asking for help on the forum because many of you are more intelligent, more experienced and focused on one particular area such as the Arduino.

Thanks once again.