Arduino IDE doesn't want to include self made library

Hello!
So i have made my own library in c++ for the Arduino platform and it works perfectly if i drop the .cpp and .h files inside of my project folder. However, if i try to include the library as a zip file the IDE just ignores it… Any idea why?

IDE version 1.6.12
the zip file is attached.

BTpass.zip (4.46 KB)

You can't include it as a zip file in your code. Unzip it and put the .h and .cpp files in a folder in the libraries folder with the same name as the .h file.

Thanks you for the advise! But isn't there a way to make a library and include it as a zip file? i did succeed doing so with other third party libraries like softwareservo that is written in c++

i did succeed doing so with other third party libraries like softwareservo that is written in c++

Please post the code that used a zipped library.

I suspect that what you actually did was to install the library from a zip file. Not the same thing at all.

i did succeed doing so with other third party libraries like softwareservo that is written in c++

No, you did not. What you did succeed in doing was to make the IDE unzip the file in the libraries folder for you. You were then able to use the files that had been in the zip file.

exactly but when i try to do the same with a library i made it simply ignores it that's the problem.
I did try to make the compiler unzip my library but it just doesn't do so....

Why are you so hung on making the IDE unzip it for you? It's not that hard to just not zip the thing and put the files in the right place.

It's not that hard to just not zip the thing

I think that it would be difficult to measure how hard it is to not do something.

But, you're right. Zipping the files is useful ONLY for distributing them to other people, why then have to unzip them.

OP: For your own use, DO NOT ZIP THE FILES.

Well thanks for the replays! and to answer the last question i did make it for distribution not self use.
If i cant "install" it in the IDE than other wont be able to niether and i would like to fix the problem.

If i cant "install" it in the IDE than other wont be able to niether and i would like to fix the problem.

If your zip file contains all the needed files, the IDE should be able to unzip the file and put the contents in the proper place. Though I think that was a dumb addition to the IDE. Unzipping a file is not rocket science.

That the IDE doesn't handle your zip file correctly suggest that it does not contain all the needed files or that the files are not in the proper structure.

PaulS:
That the IDE doesn't handle your zip file correctly suggest that it does not contain all the needed files or that the files are not in the proper structure.

I tried it and it says it doesn't contain a library.

I tried it and it says it doesn't contain a library.

I'd ask what "it" was that you tried, but I don't want to know the answer.

I'll just assume that "it" was making the IDE import your library from its zip file.

That the error message is what it is suggests that my supposition is correct. Please re-read what I said, and see if you can figure out what you need to tell us.

PaulS:
Please re-read what I said, and see if you can figure out what you need to tell us.

Yeah I was in fact supporting what you said. I'm not the OP....

ardy_guy:
Yeah I was in fact supporting what you said. I'm not the OP....

Sorry about that. I missed that the author changed.

Exactly what files are in this zip file ?

The layout of the files and subfolders inside of the library folder:

BTpass/
BTpass/keywords.txt
BTpass/library.properties

BTpass/examples
BTpass/examples/example_1.ino
BTpass/examples/example_2.ino

Btpass/src
Btpass/src/BTpass.h
Btpass/src/BTpass.cpp

And to address Paul it doesn't tell me that its not a library in my version of the IDE (1.6.12) so i don't know where the problem may be. Maybe something with the file syntax above or the IDE must have an extras folder even if its empty but according to the tutorial i made the library format with it should work as is.

And to address Paul it doesn't tell me that its not a library in my version of the IDE (1.6.12) so i don't know where the problem may be.

It doesn't give me any error, either, using 1.6.9, but it doesn't unzip the file, either. Apparently, later versions of the IDE show more messages.

Hopefully, someone who has built a library that is available through the library manager/unzip process will weigh in and tell you the magic dance steps.

Does it matter that the .cpp and .h files are a layer deeper than I recall seeing, in ../src?

ardy_guy:
Does it matter that the .cpp and .h files are a layer deeper than I recall seeing, in ../src?

The convention for current libraries is to put the code in the src directory.

This is really bizarre. I extracted the contents of the zip file, and the IDE (1.6.9) refuses to admit that the library exists, and can't find the header file when I try to include it.

So, I moved the header file and source file from the src directory to the BTpass folder, and deleted the library.properties file and the empty src directory. Still no go.

So, I renamed the BTpass folder and the BTpass.cpp and BTpass.h files, and the IDE can now see the library and can include the header file in the sketch. Of course, when it tries to compile the cpp file, it can't, because that file still references the old name.

So, it appears that the Arduino team has decided that you can not name a library BTpass. Beats the hell out of me why.