lpcware

uint8_t type gets duplicated for the LPCXpresso1549 board. SOLVED.

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by fjrg76 on Wed Dec 03 14:43:21 MST 2014
Hi,

As I've said, such type gets duplicated when compiling a project. From the info that the compiler spits out it seems to be a problem with board.h and chip.h inclusion files. This is the error output:


../src/project1.cpp:36:2: error: 'uint8_t' redeclared as different kind of symbol
  uint8_t val,
  ^
In file included from /usr/local/lpcxpresso_7.2.0_153/lpcxpresso/tools/lib/gcc/arm-none-eabi/4.8.3/include/stdint.h:9:0,
                 from /home/xavier76/LPC1549_WS/lpc_chip_15xx/inc/lpc_types.h:35,
                 from /home/xavier76/LPC1549_WS/lpc_chip_15xx/inc/chip.h:32,
                 from /home/xavier76/LPC1549_WS/lpc_board_nxp_lpcxpresso_1549/inc/board.h:35,
                 from ../src/project1.cpp:21:
/usr/local/lpcxpresso_7.2.0_153/lpcxpresso/tools/arm-none-eabi/include/stdint.h:42:19: error: previous declaration of 'typedef __uint8_t uint8_t'
typedef __uint8_t uint8_t ;


And this is the source code that fails to compile:

/*-----------------------------------------------------------------------------
*  project1.cpp cropped source code
*-----------------------------------------------------------------------------*/

#include "board.h" /***** Line (21) *****/
#include <cr_section_macros.h>

typedef enum
{
Err_OK = 0,
Err_Fail,
} Error_E;

typedef enum
{
uint8_t val, /***** Line (36) *****/
Error_E error,
} RetVal_Type;

// And from here there are a lot of errors because uint8_t type duplication




Any ideas? Thank you in advanced :)

Outcomes