Open losingrose opened 3 years ago
有没有先执行make chip=esp8266 defconfig
, 执行这个会打开 CONFIG_ENABLE_PTHREAD。https://github.com/espressif/esp-aliyun/blob/master/examples/solutions/smart_light/sdkconfig_esp8266.defaults#L2
执行后OK了,感谢你的回复。 开始被SDK和工具链的版本对应折腾了好几天,都快放弃了,使用make aliyun搞懂版本对应以后,感觉就快成功了,心急了。 希望能在文档中加一个 代码版本-SDK版本-工具链版本 的对应说明,对于新手来说很难能找到对应关系。
1. 开发环境
Ubuntu 20
git rev-parse --short HEAD
来获取 commit id):1259029git rev-parse --short HEAD
来获取 commit id):6c438bcegit rev-parse --short HEAD
来获取 commit id): Toolchain version: crosstool-ng-1.22.0-100-ge567ec72. 问题描述
make编译失败。最后报错找不到pthread_create
Generating esp8266.project.ld LD build/smart_light.elf /home/losingrose/esp/esp-aliyun/examples/solutions/smart_light/build/esp-aliyun/libesp-aliyun.a(wrapper_os.o):(.literal.HAL_ThreadCreate+0x4): undefined reference to
pthread_create' /home/losingrose/esp/esp-aliyun/examples/solutions/smart_light/build/esp-aliyun/libesp-aliyun.a(wrapper_os.o):(.literal.HAL_ThreadDelete+0x0): undefined reference to
pthread_exit' /home/losingrose/esp/esp-aliyun/examples/solutions/smart_light/build/esp-aliyun/libesp-aliyun.a(wrapper_os.o):(.literal.HAL_ThreadDelete+0x4): undefined reference topthread_cancel' /home/losingrose/esp/esp-aliyun/examples/solutions/smart_light/build/esp-aliyun/libesp-aliyun.a(wrapper_os.o):(.literal.HAL_ThreadDelete+0x8): undefined reference to
pthread_join' /home/losingrose/esp/esp-aliyun/examples/solutions/smart_light/build/esp-aliyun/libesp-aliyun.a(wrapper_os.o): In functionHAL_ThreadCreate': /home/losingrose/esp/esp-aliyun/wrappers/wrapper_os.c:267: undefined reference to
pthread_create' /home/losingrose/esp/esp-aliyun/wrappers/wrapper_os.c:267: undefined reference topthread_create' /home/losingrose/esp/esp-aliyun/examples/solutions/smart_light/build/esp-aliyun/libesp-aliyun.a(wrapper_os.o): In function
HAL_ThreadDelete': /home/losingrose/esp/esp-aliyun/wrappers/wrapper_os.c:267: undefined reference topthread_exit' /home/losingrose/esp/esp-aliyun/wrappers/wrapper_os.c:267: undefined reference to
pthread_cancel' /home/losingrose/esp/esp-aliyun/wrappers/wrapper_os.c:267: undefined reference to `pthread_join' collect2: error: ld returned 1 exit status make: *** [/home/losingrose/esp/ESP8266_RTOS_SDK/make/project.mk:510:/home/losingrose/esp/esp-aliyun/examples/solutions/smart_light/build/smart_light.elf] 错误 1