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?
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++
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....
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.
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.
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.