Search found 12 matches

by pinock
Wed Dec 04, 2019 12:32 pm
Forum: ESP-IDF
Topic: CMake target_link_libraries order problems
Replies: 0
Views: 2057

CMake target_link_libraries order problems

MySDK->MyLib->nvs_flash-> compilation success and i get libmylib.a from build MyApp->libMyLib.a -> compilation error undefined reference to nvs_flash_init() etc. idf_component_register(SRCS Main.cpp INCLUDE_DIRS REQUIRES nvs_flash MyMainLib log) add_library(MyLib STATIC IMPORTED) set_target_properti...
by pinock
Fri Nov 29, 2019 9:34 am
Forum: ESP-IDF
Topic: How to pass parameter to ESP_LOGI?
Replies: 4
Views: 9576

Re: How to pass parameter to ESP_LOGI?

Ok Solved here is the solution. int Log(LogType logType, const char* tag, const char* format, ...) { va_list vArgs; va_start(vArgs, format); char temp[VPRINTF_STACK_BUFFER_SIZE]; int len = vsnprintf(temp, sizeof(temp) - 1, format, vArgs); temp[sizeof(temp) - 1] = 0; int i; for (i = len - 1; i >= 0; ...
by pinock
Fri Nov 29, 2019 8:30 am
Forum: ESP-IDF
Topic: How to pass parameter to ESP_LOGI?
Replies: 4
Views: 9576

Re: How to pass parameter to ESP_LOGI?

thanks @wifive but i want to use exactly esp_logi(), esp_loge() etc. because i want colorizing and globally set log level.
by pinock
Thu Nov 28, 2019 9:07 pm
Forum: ESP-IDF
Topic: How to pass parameter to ESP_LOGI?
Replies: 4
Views: 9576

Re: How to pass parameter to ESP_LOGI?

btw. i don't want #define approach. there is no usable for my scenario.
by pinock
Thu Nov 28, 2019 9:05 pm
Forum: ESP-IDF
Topic: How to pass parameter to ESP_LOGI?
Replies: 4
Views: 9576

How to pass parameter to ESP_LOGI?

i want to wrapper for esp_log void Log(esp_log_level_t level, const char* tag, const char* format, ...) { va_list va; va_start(va, format); printf(format, va); ESP_LOGI(tag, format, va); va_end(va); } Severity Code Description Project File Line Suppression State Error [Clang IntelliSense] Error: exp...
by pinock
Thu Nov 21, 2019 11:41 am
Forum: ESP-IDF
Topic: CMake Static library's dependency can't be found
Replies: 0
Views: 2231

CMake Static library's dependency can't be found

MySDK uses my own MyLib and this uses nvs_flash lib. when i export mylib as a static library. mylib's give error undefined reference to nvs_flash_init() etc. what i missing? ------- MySDK->MyLib->nvs_flash-> compilation success and i get libmylib.a from build MyApp->libMyLib.a -> compilation error u...
by pinock
Tue Nov 19, 2019 8:43 am
Forum: ESP-IDF
Topic: ESP32 CMake, How to add my own static library file to project? (ESPIDF v4.1dev)
Replies: 7
Views: 10410

Re: ESP32 CMake, How to add my own static library file to project? (ESPIDF v4.1dev)

EDIT: Is BCXConfiguration.cpp the source that you want to use to make your static library? If so, I have only tried making libraries as components within a full application. So, I am not sure of the syntax for a project that is only intended to create a library. Original response: I looked at it bu...
by pinock
Sat Oct 26, 2019 2:15 pm
Forum: ESP-IDF
Topic: ESP32 CMake, How to add my own static library file to project? (ESPIDF v4.1dev)
Replies: 7
Views: 10410

Re: ESP32 CMake, How to add my own static library file to project? (ESPIDF v4.1dev)

btw. thanks for your effort. im realy grateful.

I'm developing BCXConfiguration library and i want to closed source.
by pinock
Tue Oct 22, 2019 7:01 pm
Forum: ESP-IDF
Topic: ESP32 CMake, How to add my own static library file to project? (ESPIDF v4.1dev)
Replies: 7
Views: 10410

Re: ESP32 CMake, How to add my own static library file to project? (ESPIDF v4.1dev)

yes linking succeed. but why give this error?
Screen Shot 2019-10-22 at 21.56.48.png
Screen Shot 2019-10-22 at 21.56.48.png (206.47 KiB) Viewed 10278 times

BCXConfiguration source attached