When compiling in Dev-C++ i get a multiple definitions error.
i have made sure the header file has a guard against this, but i still get the error. any ideas?
Multiple Definition Error
multiple definition of 'device'
thats all it says.
header:
and then i have a couple of source files that include that file.
shouldn't #ifndef prevent multiple inclusion?
thats all it says.
header:
Code: Select all
#ifndef HEADER_H
#define HEADER_H
IrrlichtDevice *device;
#endif
shouldn't #ifndef prevent multiple inclusion?
use
and then in header.cpp or some other cpp file,
That should do the trick
Code: Select all
#ifndef HEADER_H
#define HEADER_H
extern IrrlichtDevice *device;
#endif
Code: Select all
IrrlichtDevice *device;