How to make sure an INCLUDEd sketch gets found

I’m helping a young man get started with Arduino. He is a Mac user, I’m Windows. The kit that he has comes with a load of sketches all of which include an "#include <Elab.h> // to include needed functions from eLab Peers library " command. So when he tries to do a download, it fails because Elab.h can’t be found. He can find it on his computer and I can find it on mine so the question is where should it be on a Mac?
Thanks in advance for your help and please bear in mind that I speak Windows and C but don’t speak Mac!

When you see a "No such file or directory" error it almost always means you need to install the library that contains the missing file.

Often the code you're compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

Note that libraries may have dependencies on other libraries.

In other cases the author of the code will not have been so kind and you'll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE's Library Manager:

  • Sketch > Include Library > Manage Libraries...
  • In the "Filter your search..." box, type some keywords you have gleaned from the missing file name.
  • Scroll through the results for the right library. Click on it.
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".
  • Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add "arduino" as an additional search keyword. I will usually prefer results on github.com since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you'll need to do some evaluation to determine which seems the most appropriate, then try it out. After downloading the library you found you'll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

Thank you! That makes a huge amount of sense - I can see Elab.h in the pulldown menu you mentioned (if I pull it down a bit). I will get him to give it a crack.

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per

Hmm - not so fast, I fear. My Windows machine leapt into instant action with the Elab.h included sketch which is at the bottom of list of libraries but his Mac doesn't cooperate. He has the Elab.h file in his Arduino folder but it doesn't show up in the library list and we can't find any way to get it to do so.
I'm thiinking of stripping it down to the point where he can simply copy and paste it into his sketch but that does seem like taking the proverbial sledgedhammer to crack a walnut.
So I guess the real question is "How do I get a Mac to find a library module?"

Please post a link to where you downloaded this "Elab" library from, or if you installed it via Library Manager then tell me the full name. That will allow me to provide detailed instructions.

The PDF manual that came with the bot (pretty good manual it is, too) sends you to https://www.elabpeers/ebot-z.html and then tells you to go to Sketch > Import Library>Add library. The Elab library does not pop up in the usual list of Arduino libraries that you see when you add a new gizmo. We can see Elab.h and some other files on his computer but the compiler doesn't find them.
Elab.h contains nothing but the names of a few dozen void functions but I suppose that's OK as it works on my PC.

We are still having no luck persuading his Mac to find Elab.h even though we can see it and its associated files (4 in total) on his hard drive. Elab.h does not appear in his list of libraries in his "Manage libraries" screen nor does it appear in the list of available libraries.
So the question remains "If I have a library on the hard drive of a Mac, how do I get Arduino to see it?"

Hi @johnmycroft. Sorry for the delay responding. Unfortunately, I have not been able to open the URL you shared:
https://www.elabpeers/ebot-z.html
gives me:

This site can’t be reached
www.elabpeers took too long to respond.

I also tried accessing it via the Wayback Machine and found it had not been archived. Are you able to open that link?

OK, haha. I just actually looked at the URL and I see you forgot to add the ".com" TLD to the URL. I'll take a look at the library now.

OK, please do this:

  • Download the library: https://www.elabpeers.com/productattachments/index/download?id=197
  • (In the Arduino IDE) Sketch > Include Library > Add ZIP Library...
  • Select the downloaded file "productattachments_files_e_l_elab.zip"
  • Click the "Open" button.
  • Wait for the Arduino IDE status bar to show the message "Library added to your libraries. Check "Include Library" menu.

In order to be recognized by the Arduino IDE, a library must be installed to exactly the right place with exactly the right folder structure. When manually installing, it's easy to get this not quite right. Using the Arduino IDE's "Add ZIP Library" feature ensures it will always be installed correctly.

Brilliant job! She works! I could make a remark about the lack of answer from the supplier of the kit but I won’t. :smiley:

You're welcome. I'm glad to hear it's working now. Enjoy!
Per

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