incompatible redefinition of macro "REG_TEST_PARAMS" in C++

  • Thread starter Thread starter John paul coder
  • Start date Start date
J

John paul coder

Guest
Hi,


I am getting "incompatible redefinition of macro "REG_TEST_PARAMS"" warning message.


Below is my #define macro declaration for my current project in constants.h header file:


#define REG_TEST_PARAMS L"SOFTWARE\\AppInfo\\TestParams"


And in the include file (where it is for the complete solution) in CUtility.h, it was already given the same #define statement:


#define REG_TEST_PARAMS L"SOFTWARE\\AppInfo\\TestParams"


Because of this I am getting the above warning message.


I don't want to change the name of the #define statement that was declared in my project constants.h header file to resolve this error.


Because, this REG_TEST_PARAMS are used in many places.


Instead can I use #ifndef statement likes as shown below to resolve the warning message?

#ifndef REG_TEST_PARAMS
#define REG_TEST_PARAMS L"SOFTWARE\\AppInfo\\TestParams"
#endif


Thanks in advance

Continue reading...
 
Back
Top