Environment: I am writing C code in the Visual C++ 6.0 IDE
I have a Visual C++ console application with a bunch of files that has the main file (DriverMain.cpp) as follows :
//#include "DCR_Register.h"
#include "DCR_Utilities.h"
#include "DCR_TranslationalLoopSetting.h"
#include "DCR_FreqSynthesizer.h"
#include "DCR_AGCTable.h"
#include "DCR_TuneTx.h"
#include "DCR_TuneRx.h"
int main()
{
DCR_DisplayInitValRegs () ;
//DCR_Initialize() ;
DCR_DisplayAllRegisters () ;
return 0 ;
}
The DCR_Register.h file is as shown below
#ifndef DCR_REGISTER_H
#define DCR_REGISTER_H
#if defined(DCR_CX74017) && defined(DCR_CX74063)
#error "Should not define both DCR_CX74017 and DCR_CX74063!"
#endif
#if !defined(DCR_CX74017) && !defined(DCR_CX74063)
#error "Either DCR_CX74017 or DCR_CX74063 should be defined!"
#endif
.....
#endif /*DCR_REGISTER_H*/
As you can see either DCR_CX74017 or DCR_CX74063 needs to be defined for the application. And the DCR_Register.h files is included in all other .cpp files in the project.
In the DriverMain.cpp file (as shown above) if
1) DCR_register.h file isn't included and none of its functions called:
The software compiles fine for either compiler switches.
2)DCR_register.h file is included and one or more of its functions called:
a. For DCR_CX74017 defined, THe compile switch fails while compiling DriverMain.cpp with the following error message #error : "Either DCR_CX74017 or DCR_CX74063 should be defined!"
It seems that somehow DCR_CX74017 is not being recognized???
b. For DCR_CX74063 defined, the code compiles and executes fine
c. If both DCR_CX74063 and DCR_CX74017 are defined (for test purposes), The DriverMain.cpp files compiles fine but the rest of the .cpp files (which include DCR_Register.h) fail with the following error:
#error : "Should not define both DCR_CX74017 and DCR_CX74063!"
d. If neither DCR_CX74063 nor DCR_CX74017 are defined, all the .cpp files including DriverMain.cpp fail to compile with the following error:
#error : "Either DCR_CX74017 or DCR_CX74063 should be defined!"
It seems somehow that DCR_CX74017 is not being recognized in DriverMain.cpp.
What could possibly be going on?.
Your help is greatly appreciated.
Thanks
Best Regards
Chandra
I have a Visual C++ console application with a bunch of files that has the main file (DriverMain.cpp) as follows :
//#include "DCR_Register.h"
#include "DCR_Utilities.h"
#include "DCR_TranslationalLoopSetting.h"
#include "DCR_FreqSynthesizer.h"
#include "DCR_AGCTable.h"
#include "DCR_TuneTx.h"
#include "DCR_TuneRx.h"
int main()
{
DCR_DisplayInitValRegs () ;
//DCR_Initialize() ;
DCR_DisplayAllRegisters () ;
return 0 ;
}
The DCR_Register.h file is as shown below
#ifndef DCR_REGISTER_H
#define DCR_REGISTER_H
#if defined(DCR_CX74017) && defined(DCR_CX74063)
#error "Should not define both DCR_CX74017 and DCR_CX74063!"
#endif
#if !defined(DCR_CX74017) && !defined(DCR_CX74063)
#error "Either DCR_CX74017 or DCR_CX74063 should be defined!"
#endif
.....
#endif /*DCR_REGISTER_H*/
As you can see either DCR_CX74017 or DCR_CX74063 needs to be defined for the application. And the DCR_Register.h files is included in all other .cpp files in the project.
In the DriverMain.cpp file (as shown above) if
1) DCR_register.h file isn't included and none of its functions called:
The software compiles fine for either compiler switches.
2)DCR_register.h file is included and one or more of its functions called:
a. For DCR_CX74017 defined, THe compile switch fails while compiling DriverMain.cpp with the following error message #error : "Either DCR_CX74017 or DCR_CX74063 should be defined!"
It seems that somehow DCR_CX74017 is not being recognized???
b. For DCR_CX74063 defined, the code compiles and executes fine
c. If both DCR_CX74063 and DCR_CX74017 are defined (for test purposes), The DriverMain.cpp files compiles fine but the rest of the .cpp files (which include DCR_Register.h) fail with the following error:
#error : "Should not define both DCR_CX74017 and DCR_CX74063!"
d. If neither DCR_CX74063 nor DCR_CX74017 are defined, all the .cpp files including DriverMain.cpp fail to compile with the following error:
#error : "Either DCR_CX74017 or DCR_CX74063 should be defined!"
It seems somehow that DCR_CX74017 is not being recognized in DriverMain.cpp.
What could possibly be going on?.
Your help is greatly appreciated.
Thanks
Best Regards
Chandra