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

User avatar
By Agentsmithers
#46746 Hi Everyone!
I followed the setup instructions here and found myself having a minor issue building our my first project. Anyone have a clue why I am getting duplicate definitions with Visual Studios? Any help will be much appreciated! :)


1>------ Rebuild All started: Project: xPL_ESP8266, Configuration: Debug Win32 ------
1> CC user/Debounce.c
1> CC user/sscanf.c
1> user/sscanf.c:92:20: error: conflicting types for 'uintptr_t'
1> typedef unsigned * uintptr_t;
1> ^
1> In file included from c:\users\user\desktop\esp8266\xtensa-lx106-elf\lib\gcc\xtensa-lx106-elf\4.8.2\include\stdint.h:9:0,
1> from C:\Users\User\Desktop\ESP8266\ESP8266_RTOS_SDK-master/include/espressif/c_types.h:28,
1> from C:\Users\User\Desktop\ESP8266\ESP8266_RTOS_SDK-master/include/espressif/esp_common.h:94,
1> from user/sscanf.c:41:
1> c:\users\user\desktop\esp8266\xtensa-lx106-elf\xtensa-lx106-elf\include\stdint.h:249:35: note: previous declaration of 'uintptr_t' was here
1> typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
1> ^
1> make: *** [build/user/sscanf.o] Error 1
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command "espmake" exited with code 2.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
User avatar
By lethe
#46763 That's a common issue, since espressif is horrible at writing headers.c_types.h refibes types from stdint.h, I suggest you fix the header by removing the duplicate definitions and adding an #include <stdint.h> instead.
Another issue with their headers is, that there's a lot of missing prototypes for functions (the esphttpd project has a header to fix most of those).