external files in simpleIDE
zoraster
Posts: 10
I want to break up a file for running a 2 line lcd display into separate files but I not sure how to do it. Is it done by creating .h files and prototypes?
Comments
Long answer: Consider the libfdserial example with this list of todos:
- Best to use Project View for this.
- Create one .h header file for prototypes.
- Wrap the .h file content with #ifndef, #define ... #endif
- Put functions in separate .c files.
- Include .h file in the .c files
- Add .h and .c files to project manager.
Some of these details may require explanation. Don't hesitate to ask. I'll do my best to answer.There is also a description of creating a library in the new 0-9-40 user guide.
Why do you say add .h files to project manager.
I have been only adding a file link to the .c files who all have included there
.h file which is in the same folder as the .c file.
Are you meaning to say add a path to the .h files that are in a seperate folder
from the .c files.
Tom
Adding a .h file to the project manager ensures that it will get archived (zipped) with a project when you zip it. Not all files in the current project folder get zipped ....
The Simple Library .h files (like #include "simpletext.h") do not need to be added to the project manager since they are part of pre-compiled libraries found in the Learn/Simple Libraries folder. Pre-compied libraries, sources, and documentation will be zipped with a project if they detected by auto-lib or by including the library in the project manager. When a library is included in the project manager the -I and -L flags tell the IDE where to find things. if you add libraries outside of the Simple Library folder, you need to add them to the project. Including "Simple Libraries" in a project is less important now that auto-lib works so well.