Informing the location of libraries

Hello everyone,

I don't know if I'm posting in the right place.
If it is not correct, I request that the moderators make the correction.
Thanks.

As I have participated in the help in several projects here in the forum, I have had some difficulties with libraries.

I'll better explain.
When the OP posts a code, when I try to help, I download the code and compile it, and sometimes I even load it in the processor.

But it's common to find #include of libraries that I don't have installed on my PC.
Then I have to find the library on the web, download it and install it on my PC.
As there are similar libraries written by different authors, I don't always find the right library.

I also know that despite having an initial topic recommended for beginners to read it:
How to get the best out of this forum,
it seems that some do not read it, and insist on posting in a non-recommended way.
And even with the warning not to post code outside the </> tags, they keep posting.

Despite all this I would like to ask you to include in the topic How to get the best out of this forum, a suggestion so that the OP in the comment of the library #include write the link where to find it.

Ex:

Instead of :

#include <SolarPosition.h> //Sun position library to get sun azimuth and elevation angle

stay like this:

 #include <SolarPosition.h> //  https://github.com/KenWillmott/SolarPosition 

thank you all.

4 Likes

It appears you are using some variation of windows. If you know the name of one of the files in the library such as can.h launch the DOS prompt (command.com or command.exe). When this appears cd to c:\ assuming your files etc are on C: then enter Dir can.h /s this will search all of the directories from your location and when it finds can.h it will tell you. Do not be surprised if there is more than one. I have gotten into the habit of placing most libraries in the folder with the sketch. Then change it from <can.h> to "can.h" and it will get it from the directory. You will also need the .ccp file and sometimes others. I got into this habit because libraries kept changing and I could no longer compile code from previous years that was still running. I also have my own folder for my libraries and include a path to that. I think on windows it would be "C:\myfolder\can.h", just guessing as I use linux.

I support that, but I doubt that lot of beginners don't read the how to.
And I agree with you - all examples in a library should have a clear indentification of the include and where to download from.
BTW, Sparkfun has a nice tutorial: How to Write a Great Arduino Library

Hi,
Thanks for your comment.
My suggestion does not refer to the libraries that we have installed on our computer.
They refer to those that we do not have installed.

You say you are downloading the libraries. That implies you are not using the arduino IDE. Most participants here use the IDE. If that is your case then I would install the IDE and use it to select and download the standard libraries. You can program however you like but when searching the internet I agree it is hard to find which fork is being referenced. The IDE provides the most common version.

Not all libraries are installable with Library Manager. The filename of a missing .h file does not always map to a specific library in Library Manager. There may be multiple libraries in Library Manager that match the filename and it is possible that none of them is the library that the poster has installed.

I will sometimes make an effort to install missing libraries and sometimes I comment out the #include and hope I don't have to comment out so much of the sketch that I can't reproduce an error.

Sometimes I switch to a different library for the same device in the hopes that the two libraries are mostly compatible.

I'm astonished there is so much confusion about what @ruilviana said.

Anyone who has been a helper here on the forum for longer than a month or two has seen this sort of thread repeatedly:

helpee: My codez dunt werk plzzz halp me
helper: Please post your code using code tags...
helpee: *posts code without code tags*
helper: I said using code tags...
helpee: *no response*
helper: OK, whatever. Please tell me where I can get the library for the xyz123.h file in the #include directive on your sketch.
helpee: I found it on the internet.
helper: Please provide the link to it.
helpee: *provides link*

All this is needed before we can even get started on providing assistance. It might take multiple days to get to this point, whereas if all the necessary information was provided from the start the solution would probably have been given in a matter of minutes.

I agree we should add that to the list of requests that new forum members ignore. :wink:

1 Like

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