EXPORT_SYMBOL in header causes "exported twice" errors

view story

http://stackoverflow.com – I have a header file with the declaration of several global variables in the following format: constants.h #ifndef CONSTANTS_H #define CONSTANTS_H extern unsigned var; EXPORT_SYMBOL(var); #endif constants.c #include "constants.h" unsigned var = 10; foo.c #include "constants.h" When I try to compile the kernel module, I get the following error for each respective exported symbol: WARNING: /home/vilhelm/proj/constants: 'var' exported twice. Previous export was in /home/vilhelm/proj/foo.ko I suspect that the symbols are being exported every time I include the constants.h header fil (HowTos)