Category : include-guards

While implementing three files (tree.h, tree.cpp, and node.h) into an existing project, I’ve run into "multiple definition of" errors when trying to reference them in my parser.h and parser.cpp files. I am using include guards to prevent multiple inclusion but I don’t think that is doing what I want it to. I am also using ..

Read more

I have two header files, animation.h and hero.h, here is the code for animation.h: #include <SFML/Graphics.hpp> #include <iostream> #include "hero.h" #ifndef ANIMATION #define ANIMATION //Class #endif And for hero.h: #include <SFML/Graphics.hpp> #include <iostream> #include "animation.h" #ifndef HERO #define HERO //Class #endif I get the error message #include file "" includes itself even when using include ..

Read more

I’m trying to understand Steinberg’s VST SDK. What’s the use of this: #define PLUGIN_API without assiging any value in a header file and then PLUGIN_API occurring in many member functions’ declarations/definitions for example like this: Steinberg::tresult PLUGIN_API initialize (Steinberg::FUnknown* context) SMTG_OVERRIDE; Steinberg::tresult PLUGIN_API terminate () SMTG_OVERRIDE; Can someone explain this? The only use of #define ..

Read more