In everything else I've had to work with, and my own code, it seems that data arrays need to be declared extern in the .h file and then defined in the .cpp file. But here, the fonts are defined and declared in the .h file, and the linker doesn't give multiple-definitions-of errors, even in the same project where it will give that error if I try to do it. In both cases the file in question is, at least indirectly, included in several other files, causing it to give errors that the array is defined "in a file included by..." and all eventually pointing to the original .h file.
Can someone please explain by what method you were able to do this? It would be extremely useful to me, and I can't find anything out about this and no one else seems to know how this is even possible.
I refer to the OLEDDisplayFonts.h file. If I try to make a font file with my own fonts, even if I copy this one exactly except for the array contents, it gives me linker errors. Help?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
In everything else I've had to work with, and my own code, it seems that data arrays need to be declared extern in the .h file and then defined in the .cpp file. But here, the fonts are defined and declared in the .h file, and the linker doesn't give multiple-definitions-of errors, even in the same project where it will give that error if I try to do it. In both cases the file in question is, at least indirectly, included in several other files, causing it to give errors that the array is defined "in a file included by..." and all eventually pointing to the original .h file.
Can someone please explain by what method you were able to do this? It would be extremely useful to me, and I can't find anything out about this and no one else seems to know how this is even possible.
I refer to the OLEDDisplayFonts.h file. If I try to make a font file with my own fonts, even if I copy this one exactly except for the array contents, it gives me linker errors. Help?