CodeWarrior 10 Macro Redefined Compile Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CodeWarrior 10 Macro Redefined Compile Error

Jump to solution
2,663 Views
jimfell
Contributor III

I'm migrating a CodeWarrior classic project to CodeWarrior 10, and I'm having a little trouble getting the ported project to compile.  I did use the CodeWarrior Classic Project Importer, and the import wizard seemed to successfully complete.

 

After creating a new header file for the symbols that were defined in the CW Classic Preprocessor project settings, I set that file as the ColdFire Compiler Input Prefix File in the CW10 project settings.  Compiling the project yielded the following macro redefinition error:

 

=#define _MSL_OS_TIME_SUPPORT 1

>macro '_MSL_OS_TIME_SUPPORT' redefined

"C:/Program Files/Freescale/CW MCU v10.2/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf" @@"Sources/main.args" -o "Sources/main_c.obj" "C:/[PROJECT DIR]/Sources/main.c" -MD -gccdep

C:/Program Files/Freescale/CW MCU v10.2/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf|Compiler|Error

C:/Program Files/Freescale/CW MCU v10.2/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf|Compiler|Error

(C:\[PROJECT DIR]\Preincludes\410-2011rOBDMain.h|9|8|20|334|20)

C:/Program Files/Freescale/CW MCU v10.2/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf|Compiler|Error

(C:\[PROJECT DIR]\Preincludes\410-2011rOBDMain.h|9|8|20|334|20)

C:/Program Files/Freescale/CW MCU v10.2/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf|Compiler|Error

=#define _MSL_OS_TIME_SUPPORT 1

(C:\[PROJECT DIR]\Preincludes\410-2011rOBDMain.h|9|8|20|334|20)

=#define _MSL_OS_TIME_SUPPORT 1

=#define _MSL_OS_TIME_SUPPORT 1

>(included from:

(C:\[PROJECT DIR]\Preincludes\410-2011rOBDMain.h|9|8|20|334|20)

>       (command-line defines):1

C:/Program Files/Freescale/CW MCU v10.2/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf|Compiler|Error

>macro '_MSL_OS_TIME_SUPPORT' redefined

>(included from:

>macro '_MSL_OS_TIME_SUPPORT' redefined

>macro '_MSL_OS_TIME_SUPPORT' redefined

>macro '_MSL_OS_TIME_SUPPORT' redefined

>       (command-line defines):1

>       (C-C++ Preprocessor Panel):1

 

What gets me is the references to the command-line definitions.  _MSL_OS_TIME_SUPPORT is defined in the new header file previously mentioned.  I don't see anywhere in the CW10 project settings where this macro would be getting defined.  Any help would be appreciated.  Thanks.

 

Labels (1)
0 Kudos
Reply
1 Solution
1,349 Views
CrasyCat
Specialist III

Hello

The prefix file you are using to build your application is specified in Project Properties  C/C++ Build > Settings > ColdFire Compiler > Input page, in field Prefix File.

Additional macros can be defined on the command line in Project Properties  C/C++ Build > Settings > ColdFire Compiler > Language Settings page, in field Other flags.

The macro redefinition warning might also be generated because the file 410-2011rOBDMain.h is included several times.

Can you try to add following line to your prefix file:

    #pragma once on

This should prevents header files from being processed more than once.

CrasyCat

View solution in original post

0 Kudos
Reply
1 Reply
1,350 Views
CrasyCat
Specialist III

Hello

The prefix file you are using to build your application is specified in Project Properties  C/C++ Build > Settings > ColdFire Compiler > Input page, in field Prefix File.

Additional macros can be defined on the command line in Project Properties  C/C++ Build > Settings > ColdFire Compiler > Language Settings page, in field Other flags.

The macro redefinition warning might also be generated because the file 410-2011rOBDMain.h is included several times.

Can you try to add following line to your prefix file:

    #pragma once on

This should prevents header files from being processed more than once.

CrasyCat

0 Kudos
Reply