I have such as this IGlobal.h file:
#ifndef _IGLOBALS_
#define _IGLOBALS_
#define _USE_MATH_DEFINES
#define PLUG_NUM_CHANNELS 2
#define PLUG_NUM_PRESETS 1
#define PLUG_FPS 100
#define PLUG_PPQ 96
#define KNOB_NUM_FRAMES 128
#define PIANOROLL_MIN_NOTES 2
#define PIANOROLL_MAX_NOTES 8
#define PIANOROLL_MIN_VELOCITY 40
#define PIANOROLL_MAX_VELOCITY 127
#define PIANOROLL_PATTERN_LENGTH PLUG_PPQ * 4
#define LFO_NUM_SAMPLES 882
#define WAVEPLAYER_WIDTH 441
#define WAVEPLAYER_HEIGHT 136
#define WAVEPLAYER_PATH_LENGTH 256
#define ENVELOPE_MIN_VALUE 0.0001
#include <algorithm>
#include <random>
#include <chrono>
#include <math.h>
#include <cmath>
#include "IPlug_include_in_plug_hdr.h"
using namespace std;
// bitmaps
IBitmap gBitmapKnobGeneral;
#endif // !_IGLOBALS_
which I include often from .h/.cpp file within the project. IBitmap
is a struct.
When I Build (compile), it says:
LNK1169 one or more multiply defined symbols found
LNK2005 "struct IBitmap gBitmapKnobGeneral" ?gBitmapKnobGeneral@@3UIBitmap@@A) already defined in ICustomControls.obj
And in fact I have it for each time I include IGlobal.h. Shouldn't #ifndef discard this problem? Or compiler automatically does it only for declarations
and not definitions
?