Strange build error: /main.c:69:77: error: implicit declaration of function 'esp_err_to_name'
Posted: Sun Jun 10, 2018 12:47 pm
Hello folks,
when trying to compile: https://github.com/FieldTracks/JellingStone - I got a very strange error message
System is: Debian Strecht, gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1), esp idf is: release/v3.0 (commit c2b39f4a5f4234d3276bec40d42132589739d655, Jun 1 2018) - the project uses https://github.com/tuanpmt/espmqtt.git
It looks like, the system has issue parsing esp_log.h - however, I can compile the example without any problems.
when trying to compile: https://github.com/FieldTracks/JellingStone - I got a very strange error message
Code: Select all
C build/main/main.o
In file included from /home/esp32/esp-idf/components/bt/bluedroid/include/bt_trace.h:26:0,
from /home/esp32/esp-idf/components/bt/bluedroid/include/bt_target.h:1834,
from /home/esp32/esp-idf/components/bt/bluedroid/device/include/controller.h:25,
from /home/esp32/JellingStone/main/./main.c:23:
/home/esp32/JellingStone/main/./main.c: In function 'init':
/home/esp32/JellingStone/main/./main.c:69:77: error: implicit declaration of function 'esp_err_to_name' [-Werror=implicit-function-declaration]
ESP_LOGE(MY_TAG, "%s initialize controller failed: %s\n", __func__, esp_err_to_name(ret));
^
/home/esp32/esp-idf/components/log/include/esp_log.h:242:168: note: in definition of macro 'ESP_LOGE'
(LOG_LOCAL_LEVEL >= ESP_LOG_ERROR) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__
^
/home/esp32/esp-idf/components/log/include/esp_log.h:203:27: error: format '%s' expects argument of type 'char *', but argument 7 has type 'int' [-Werror=format=]
#define LOG_COLOR(COLOR) "\033[0;" COLOR "m"
^
/home/esp32/esp-idf/components/log/include/esp_log.h:206:27: note: in expansion of macro 'LOG_COLOR'
#define LOG_COLOR_E LOG_COLOR(LOG_COLOR_RED)
^
/home/esp32/esp-idf/components/log/include/esp_log.h:220:37: note: in expansion of macro 'LOG_COLOR_E'
#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%d) %s: " format LOG_RESET_COLOR "\n"
^
/home/esp32/esp-idf/components/log/include/esp_log.h:242:117: note: in expansion of macro 'LOG_FORMAT'
#define ESP_LOGE( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_ERROR) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format)
^
/home/esp32/JellingStone/main/./main.c:69:9: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(MY_TAG, "%s initialize controller failed: %s\n", __func__, esp_err_to_name(ret));
^
/home/esp32/esp-idf/components/log/include/esp_log.h:203:27: error: format '%s' expects argument of type 'char *', but argument 7 has type 'int' [-Werror=format=]
#define LOG_COLOR(COLOR) "\033[0;" COLOR "m"
^
/home/esp32/esp-idf/components/log/include/esp_log.h:206:27: note: in expansion of macro 'LOG_COLOR'
#define LOG_COLOR_E LOG_COLOR(LOG_COLOR_RED)
^
/home/esp32/esp-idf/components/log/include/esp_log.h:220:37: note: in expansion of macro 'LOG_COLOR_E'
#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%d) %s: " format LOG_RESET_COLOR "\n"
^
/home/esp32/esp-idf/components/log/include/esp_log.h:242:117: note: in expansion of macro 'LOG_FORMAT'
#define ESP_LOGE( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_ERROR) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format)
^
/home/esp32/JellingStone/main/./main.c:74:9: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(MY_TAG, "%s enable controller failed: %s\n", __func__, esp_err_to_name(ret));
^
/home/esp32/esp-idf/components/log/include/esp_log.h:203:27: error: format '%s' expects argument of type 'char *', but argument 7 has type 'int' [-Werror=format=]
#define LOG_COLOR(COLOR) "\033[0;" COLOR "m"
^
/home/esp32/esp-idf/components/log/include/esp_log.h:206:27: note: in expansion of macro 'LOG_COLOR'
#define LOG_COLOR_E LOG_COLOR(LOG_COLOR_RED)
^
/home/esp32/esp-idf/components/log/include/esp_log.h:220:37: note: in expansion of macro 'LOG_COLOR_E'
#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%d) %s: " format LOG_RESET_COLOR "\n"
^
/home/esp32/esp-idf/components/log/include/esp_log.h:242:117: note: in expansion of macro 'LOG_FORMAT'
#define ESP_LOGE( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_ERROR) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format)
^
/home/esp32/JellingStone/main/./main.c:79:9: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(MY_TAG, "%s initialize bluedroid failed: %s\n", __func__, esp_err_to_name(ret));
^
/home/esp32/esp-idf/components/log/include/esp_log.h:203:27: error: format '%s' expects argument of type 'char *', but argument 7 has type 'int' [-Werror=format=]
#define LOG_COLOR(COLOR) "\033[0;" COLOR "m"
^
/home/esp32/esp-idf/components/log/include/esp_log.h:206:27: note: in expansion of macro 'LOG_COLOR'
#define LOG_COLOR_E LOG_COLOR(LOG_COLOR_RED)
^
/home/esp32/esp-idf/components/log/include/esp_log.h:220:37: note: in expansion of macro 'LOG_COLOR_E'
#define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%d) %s: " format LOG_RESET_COLOR "\n"
^
/home/esp32/esp-idf/components/log/include/esp_log.h:242:117: note: in expansion of macro 'LOG_FORMAT'
#define ESP_LOGE( tag, format, ... ) if (LOG_LOCAL_LEVEL >= ESP_LOG_ERROR) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format)
^
/home/esp32/JellingStone/main/./main.c:84:9: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(MY_TAG, "%s enable bluedroid failed: %s\n", __func__, esp_err_to_name(ret));
^
cc1: some warnings being treated as errors
/home/esp32/esp-idf/make/component_wrapper.mk:273: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
/home/esp32/esp-idf/make/project.mk:450: recipe for target 'component-main-build' failed
make: *** [component-main-build] Error 2
It looks like, the system has issue parsing esp_log.h - however, I can compile the example without any problems.