Can you give me a detailed procedure?
It should be the same as in plain old CMake:
add_library(<library-name> STATIC <your-source-files>)
That should compile your source files and archive them to a
target_link_libraries(COMPONENT_LIB <PUBLIC|PRIVATE> <library-name>)
Or am I missing something with your question?
I know how to create the .a files.
but I don't know how to add a .a file to my project.
Can you give me an example base on the HelloWorld project?
You mean a pre-built .a file, you want to link that to your project? You can add it as an imported library:
add_library(<library-name> STATIC IMPORTED)
set_property(TARGET <library-name> PROPERTY IMPORTED_LOCATION <path-to-library-archive>)
See components/esp_wifi/CMakeLists.txt for how we include the wifi libraries (libcoexist.a, libmesh.a, etc.)
你可以自己写.mk规则,然后在项目Makefile中添加引用
@WangYifa Can this be closed?
@WangYifa Thanks for reporting this, due to that IDF issue template has been ignored, will close the ticket for now. For questions, you can raise a post on our forum. Thanks.
I've been dealing with this for a long time. but I couldn't get it to work and finally decided to write here. please make a small "hello world" example.
Ok, will do @drony. This will be low priority though because using a pre-built binary isn't exactly specific to ESP-IDF and there is already some example mentioned in esp_wifi.
@renzbagaporo thanks for response. i read everything about this problem. bu i can't get any result. and i'm tired:(
similiar basic sample is here. can you help me/us(i thing lot of people strugling this issue)
https://github.com/espressif/esp-idf/issues/4210
thanks is advance.