Forum Discussion
Altera_Forum
Honored Contributor
21 years agoconditional compilation ?
Hello. I'm working with two kits of development NIOSII. I wish to use the following conditional compilation in a common file (as user.h) : // --- choice of board ---------------...
Altera_Forum
Honored Contributor
21 years agoIf you try to# include your "user.h" file in more than one module, then you will be attempting to define multiple global variables of the same name, hence the error. If this is the case you may need to create a further condition in only one module. Perhaps something like:
# define MAIN_MODULE# include "user.h"# undef MAIN_MODULE then in your user.h file, something like: # ifdef MAIN_MODULE const char adresse_mac_ethernet[6] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06} ;# else extern const char adresse_mac_ethernet[];# endif Good luck