Header hell

When you’re trying to make new stuff work, you begin by setting everything up, coding test routines, solving problems, and when everything seems to work the way it’s supposed to, you try to put the code in a more formal way to be usable by the rest of the program. And that’s typically the moment when new and unexpected problems arise …

Actually, the problem I ran into was related to file header inclusion and external variables declaration. Some headers were included more than once, others were overlapping, etc … A real mess.
After looking around to see what’ll be the best way to solve this, I decided to put every needed header file in a single one which will be called by every cpp file. It went smoothly on the code generation, but then the linker went berserk : more than 1000 errors ! What the hell ?!??

I had to dig further into my code, and finally I found out what was the problem : some extern variables were explicitally declared as using C linkage, result of years of coding without knowing in depth some of the specificities of the language …
Now everything uses C++ linkage, Saturnin compiles like a charm, and that’s great news 🙂

Back to my SPTI routines now … :p