使用自带例子编译出错



  • [ INFO] [100%] Linking C executable gpio_led_standalone
    [ INFO] c:/updater.beta.20190221.1.win32/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: c:/updater.beta.20190221.1.win32/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-vfprintf.o): in function _vfprintf_r': [ INFO] vfprintf.c:(.text._vfprintf_r+0x66): undefined reference topthread_setcancelstate'
    [ INFO] c:/updater.beta.20190221.1.win32/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: vfprintf.c:(.text._vfprintf_r+0xac): undefined reference to pthread_setcancelstate' [ INFO] c:/updater.beta.20190221.1.win32/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: vfprintf.c:(.text._vfprintf_r+0xd2): undefined reference topthread_setcancelstate'
    [ INFO] c:/updater.beta.20190221.1.win32/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: vfprintf.c:(.text._vfprintf_r+0x682): undefined reference to pthread_setcancelstate' [ INFO] c:/updater.beta.20190221.1.win32/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: c:/updater.beta.20190221.1.win32/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-fflush.o): in function.L47':
    [ INFO] fflush.c:(.text._fflush_r+0x24): undefined reference to pthread_setcancelstate' [ INFO] c:/updater.beta.20190221.1.win32/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: c:/updater.beta.20190221.1.win32/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-fflush.o):fflush.c:(.text._fflush_r+0x3a): more undefined references topthread_setcancelstate' follow
    [ INFO] collect2.exe: error: ld returned 1 exit status
    [ INFO] mingw32-make.exe[2]: *** [CMakeFiles/gpio_led_standalone.dir/build.make:84: gpio_led_standalone] Error 1
    [ INFO] mingw32-make.exe[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/gpio_led_standalone.dir/all] Error 2
    [ INFO] mingw32-make.exe: *** [Makefile:84: all] Error 2
    [ INFO]
    [ INFO] Build Error: C:/updater.beta.20190221.1.win32/KendryteIDE/LocalPackage/cmake/bin/cmake.exe exited with code 2.


  • Staff

    请问用的是最新的SDK和Toolchain吗? 看这个错误应该是用了不匹配的版本, 抱歉历史上有过一些不能backporting的升级, 可以尝试github上最新的SDK和toolchain.