|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
||||
|
||||
|
Re: Multiple Definitions
You want the compiler to encounter only one declaration for the variable as it processes the set of source source files. Your technique above is designed to prevent multiple references or forward references to be encountered , not multiple variables. I'm sure your custom_routines.h file is processed when you compile multiple separate source files.
So do his, change the statement in custom_routines.h to an external reference and declare storage for the variable in ONLY one source file. In custom_routines.h, do this: #ifndef _CUSTOM_ROUTINES_H_ #define _CUSTOM_ROUTINES_H_ ... extern bool ReleasingBall; ... #endif In custom_routines.c, do this: .... #include <timer.h> #include "custom_routines.h" bool ReleasingBall; // defined only here! // function definitions ... One last thing, it is generally considered bad style to define storage in a header file for exactly the reason you have encountered. HTH |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Short definitions of overdrive | HedlessChkn | General Forum | 3 | 13-01-2008 21:52 |
| Hosting multiple sites in multiple VMs | EHaskins | Website Design/Showcase | 6 | 22-12-2007 01:09 |
| Error - symbol 'command_list' has multiple definitions. | Moloch | Programming | 2 | 17-02-2005 17:32 |
| Error - symbol 'e' has multiple definitions. HELLPPPPP | BookerT | Programming | 2 | 24-01-2005 21:50 |