Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Wamor
#41460 Hello,

I am new to the ESP8266 and am learning to use the product.

I have made a small cpp-program and when compiling I got the following errors:

conflicting declaration 'typedef int int32_t' line 80, external location: c:\espressif\xtensa-lx106-elf\xtensa-lx106-elf\include\stdint.h
previous declaration as 'typedef long int int32_t' line 17, external location: c:\Espressif\ESP8266_SDK\include\c_types.h

Looks like something is redefining int32_t.
My program look like this:
#include "espmissingincludes.h"
#include <osapi.h>

extern "C" void user_rf_pre_init(void)
{
}

extern "C" void user_init(void)
{
os_delay_us(1000);
}

In stdint.h I see the following lines:
#if TENSILICA || 1
typedef signed int int32_t;
typedef unsigned int uint32_t;
#else
typedef signed long int32_t;
typedef unsigned long uint32_t;
#endif

What is TENSILICA and why int32_ and uint32_t forced to be int's.

Can somebody help me to solve this problem.

Thank you and best regards,

Wamor
User avatar
By jcmvbkbc
#41625
Wamor wrote:conflicting declaration 'typedef int int32_t' line 80, external location: c:\espressif\xtensa-lx106-elf\xtensa-lx106-elf\include\stdint.h
previous declaration as 'typedef long int int32_t' line 17, external location: c:\Espressif\ESP8266_SDK\include\c_types.h

Just remove definitions of int/uint 8..64 from c_types.h and replace it with #include <stdint.h> -- should work regardless of the typedef in the stdint.h