This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123GH6PM: error #242: duplicate specifier in declaration

Part Number: TM4C123GH6PM


Tool/software: Code Composer Studio

Hi,

I am trying to compile a project for TM4C123GH6PM launchpad. I started of with one of the TI supplied sample projects and am adding my own modules to it piece by piece.

Unfortunately I am now stuck at a issue where the compiler complains as below:

```

>> Compilation failure
subdir_rules.mk:9: recipe for target 'main.obj' failed
"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h", line 42: error #242:
duplicate specifier in declaration
typedef signed char int8_t;
^

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h", line 42: error #85:
invalid combination of type specifiers
typedef signed char int8_t;
^

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h", line 43: error #242:
duplicate specifier in declaration
typedef unsigned char uint8_t;
^

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h", line 43: error #85:
invalid combination of type specifiers
typedef unsigned char uint8_t;
^

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h", line 44: error #242:
duplicate specifier in declaration
typedef short int16_t;
^

"C:/TI/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS/include/stdint.h", line 44: warning #377-D:
declaration requires a typedef name
typedef short int16_t;
^

```

I can understand that the compiler is telling me there is already a typedef done for int8_t but what is the way to know where the

first type definition has been done(I am not able to figure that out from the compiler error message) ?

  • Hi Sudeep,
    Welcome to the forum.
    Look at your list of include files in "main.c". You can move "stdint.h" to the top of the list. Now the other include file (or main.c itself) will show as the offending duplicator of the typedefs.