编译C++代码出错



  • main.c 文件:
    #include <stdio.h>
    extern int main_test();
    int main() {
    puts("Hello World\n");
    main_test();
    return 1;
    }

    test.cpp:
    extern "C" int main_test() { return 0; }
    编译的log:

    Starting build...
    [ INFO] rescan current folder: n:/bitcoin/test-proj2
    [ INFO] Workspace folder changed, stopping CMake server...
    [ INFO] detecting project in n:/bitcoin/test-proj2
    [ INFO]   kendryte-package.json found.
    [ INFO]   CMakeLists.txt found.
    [ INFO]     - is safe to delete it.
    [ INFO]   - CMake project is exists.
    [ INFO] Generate CMakeLists.txt file:
    [ INFO] Adding project: n:/bitcoin/test-proj2
    [ INFO] Dependency:
    [ INFO] Adding project: n:/bitcoin/test-proj2/kendryte_libraries/kendryte-standalone-sdk
    [ INFO] Dependency:
    [ INFO]    No project dependency
    [ INFO]    No folder dependency
    [ INFO]    No folder dependency
    [ INFO] [Flash Manager] NOT enabled for hello_world.
    [ INFO] [Flash Manager] NOT enabled for kendryte-standalone-sdk.
    [ INFO] Generating IDE tools hook file...
    [ INFO]     hello_world - No hooks registered.
    [ INFO]     kendryte-standalone-sdk - No hooks registered.
    [ INFO] Source to match 4:
    [ INFO]  + lib/**/*.c
    [ INFO]  + lib/**/*.cpp
    [ INFO]  + lib/**/*.s
    [ INFO]  + lib/**/*.S
    [ INFO]  - build/**
    [ INFO]  - kendryte_libraries/**
    [ INFO]  - .*
    [ INFO]  - .*/**
    [ INFO] from directory: n:/bitcoin/test-proj2/kendryte_libraries/kendryte-standalone-sdk
    [ INFO] Matched source file count: 31.
    [ INFO] Source to match 3:
    [ INFO]  + src/*.c
    [ INFO]  + src/*.cpp
    [ INFO]  + src/*.h
    [ INFO]  - build/**
    [ INFO]  - kendryte_libraries/**
    [ INFO]  - .*
    [ INFO]  - .*/**
    [ INFO] from directory: n:/bitcoin/test-proj2
    [ INFO] Matched source file count: 2.
    [ INFO] All defined constants:
    [ INFO] configuring project: n:/bitcoin/test-proj2/CMakeLists.txt
    [ INFO] --no-warn-unused-cli
    -Wno-dev
    -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
    -DKENDRYTE_IDE=yes
    [ INFO] currentFolder=n:/bitcoin/test-proj2
    [ INFO] pipeFilePath=\\?\pipe\kide.cmake_server_pipe.1560611081137
    [ INFO] Start new CMake Server: N:/bitcoin/KendryteIDE/LocalPackage/cmake/bin/cmake.exe -E server --experimental --pipe=\\?\pipe\kide.cmake_server_pipe.1560611081137
    CWD=N:/bitcoin/KendryteIDE/LocalPackage/cmake/bin
    [ INFO] PATH:
    [ INFO]   - n:\bitcoin\KendryteIDE\bin
    [ INFO]   - N:\bitcoin\KendryteIDE\LocalPackage\toolchain\bin
    [ INFO]   - N:\bitcoin\KendryteIDE\LocalPackage\cmake\bin
    [ INFO]   - N:\bitcoin\KendryteIDE\LocalPackage\jlink
    [ INFO]   - N:\bitcoin\KendryteIDE\LocalPackage\clang-format\bin
    [ INFO]   - C:\WINDOWS\system32
    [ INFO]   - C:\WINDOWS
    [ INFO]   - C:\WINDOWS\System32\Wbem
    [ INFO]   - C:\WINDOWS\System32\WindowsPowerShell\v1.0
    [ INFO]   - C:\WINDOWS\System32\OpenSSH
    [ INFO] Started new CMake Server instance with PID 15976
    [ INFO] CMake connect: \\?\pipe\kide.cmake_server_pipe.1560611081137
    [ INFO] ======== PROJECT:hello_world ========
    [ INFO] The C compiler identification is GNU 8.2.0
    [ INFO] The CXX compiler identification is GNU 8.2.0
    [ INFO] Detecting C compiler ABI info
    [ INFO] Detecting C compiler ABI info - done
    [ INFO] Detecting C compile features
    [ INFO] Detecting C compile features - done
    [ INFO] Detecting CXX compiler ABI info
    [ INFO] Detecting CXX compiler ABI info - done
    [ INFO] Detecting CXX compile features
    [ INFO] Detecting CXX compile features - done
    [ INFO]    Entering             N:/bitcoin/test-proj2/kendryte_libraries/kendryte-standalone-sdk
    [ INFO] ======== PROJECT:kendryte-standalone-sdk ========
    [ INFO] config flags for kendryte-standalone-sdk
    [ INFO] Project: kendryte-standalone-sdk
    [ INFO]   LIST_FILE=N:/bitcoin/test-proj2/kendryte_libraries/kendryte-standalone-sdk/CMakeLists.txt
    [ INFO]   TOOLCHAIN=
    [ INFO]   KENDRYTE_IDE=yes
    [ INFO]   BUILDING_SDK=
    [ INFO]   _CMAKE_TOOLCHAIN_PREFIX=riscv64-unknown-elf-
    [ INFO]   _CMAKE_TOOLCHAIN_LOCATION=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin
    [ INFO]   CMAKE_BUILD_TYPE=Debug
    [ INFO]   CMAKE_C_COMPILER=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin/riscv64-unknown-elf-gcc.exe
    [ INFO]   CMAKE_CXX_COMPILER=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin/riscv64-unknown-elf-g++.exe
    [ INFO]   CMAKE_LINKER=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin/riscv64-unknown-elf-ld.exe
    [ INFO]   CMAKE_OBJCOPY=riscv64-unknown-elf-objcopy.exe
    [ INFO]   CMAKE_OBJDUMP=riscv64-unknown-elf-objdump.exe
    [ INFO]   CMAKE_MAKE_PROGRAM=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin/make.exe
    [ INFO]   CMAKE_C_FLAGS= -mcmodel=medany
    [ INFO]   CMAKE_CXX_FLAGS= -mcmodel=medany
    [ INFO]   LDFLAGS=
    [ INFO]   LINK_FLAGS=
    [ INFO]   CMAKE_BINARY_DIR=n:/bitcoin/test-proj2/build
    [ INFO] Makefile created.
    [ INFO]    Returning to         N:/bitcoin/test-proj2
    [ INFO] config flags for hello_world
    [ INFO] Project: hello_world
    [ INFO]   LIST_FILE=N:/bitcoin/test-proj2/CMakeLists.txt
    [ INFO]   TOOLCHAIN=
    [ INFO]   KENDRYTE_IDE=yes
    [ INFO]   BUILDING_SDK=
    [ INFO]   _CMAKE_TOOLCHAIN_PREFIX=riscv64-unknown-elf-
    [ INFO]   _CMAKE_TOOLCHAIN_LOCATION=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin
    [ INFO]   CMAKE_BUILD_TYPE=Debug
    [ INFO]   CMAKE_C_COMPILER=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin/riscv64-unknown-elf-gcc.exe
    [ INFO]   CMAKE_CXX_COMPILER=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin/riscv64-unknown-elf-g++.exe
    [ INFO]   CMAKE_LINKER=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin/riscv64-unknown-elf-ld.exe
    [ INFO]   CMAKE_OBJCOPY=riscv64-unknown-elf-objcopy.exe
    [ INFO]   CMAKE_OBJDUMP=riscv64-unknown-elf-objdump.exe
    [ INFO]   CMAKE_MAKE_PROGRAM=N:/bitcoin/KendryteIDE/LocalPackage/toolchain/bin/make.exe
    [ INFO]   CMAKE_C_FLAGS= -mcmodel=medany
    [ INFO]   CMAKE_CXX_FLAGS= -mcmodel=medany
    [ INFO]   LDFLAGS= -mcmodel=medany
    [ INFO]   LINK_FLAGS=
    [ INFO]   CMAKE_BINARY_DIR=n:/bitcoin/test-proj2/build
    [ INFO] Makefile created.
    [ INFO] Configuring done
    [ INFO] Generating done
    [ INFO] write config to n:/bitcoin/test-proj2/.vscode/c_cpp_properties.json
    [ INFO] write config for cpp extension.
    [ INFO] 
    [ INFO] ~ Configure complete! ~
    
    ===================
    
    [ INFO] Run cmake build:
    [ INFO] Scanning dependencies of target kendryte-standalone-sdk
    [ INFO] [  2%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/bsp/crt.S.obj
    [ INFO] [  5%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/bsp/entry.c.obj
    [ INFO] [  8%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/bsp/entry_user.c.obj
    [ INFO] [ 11%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/bsp/interrupt.c.obj
    [ INFO] [ 14%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/bsp/locks.c.obj
    [ INFO] [ 17%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/bsp/printf.c.obj
    [ INFO] [ 20%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/bsp/sleep.c.obj
    [ INFO] [ 22%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/bsp/syscalls.c.obj
    [ INFO] [ 25%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/aes.c.obj
    [ INFO] [ 28%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/apu.c.obj
    [ INFO] [ 31%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/clint.c.obj
    [ INFO] [ 34%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/dmac.c.obj
    [ INFO] [ 37%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/dvp.c.obj
    [ INFO] [ 40%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/fpioa.c.obj
    [ INFO] [ 42%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/fft.c.obj
    [ INFO] [ 45%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/gpio.c.obj
    [ INFO] [ 48%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/gpiohs.c.obj
    [ INFO] [ 51%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/i2c.c.obj
    [ INFO] [ 54%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/i2s.c.obj
    [ INFO] [ 57%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/kpu.c.obj
    [ INFO] [ 60%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/plic.c.obj
    [ INFO] [ 62%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/pwm.c.obj
    [ INFO] [ 65%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/rtc.c.obj
    [ INFO] [ 68%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/sha256.c.obj
    [ INFO] [ 71%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/sysctl.c.obj
    [ INFO] [ 74%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/spi.c.obj
    [ INFO] [ 77%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/timer.c.obj
    [ INFO] [ 80%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/uart.c.obj
    [ INFO] [ 82%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/uarths.c.obj
    [ INFO] [ 85%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/utils.c.obj
    [ INFO] [ 88%] Building C object kendryte-standalone-sdk/CMakeFiles/kendryte-standalone-sdk.dir/lib/drivers/wdt.c.obj
    [ INFO] [ 91%] Linking C static library libkendryte-standalone-sdk.a
    [ INFO] [ 91%] Built target kendryte-standalone-sdk
    [ INFO] Scanning dependencies of target hello_world
    [ INFO] [ 94%] Building C object CMakeFiles/hello_world.dir/src/main.c.obj
    [ INFO] [ 97%] Building CXX object CMakeFiles/hello_world.dir/src/test.cpp.obj
    [ INFO] [100%] Linking CXX executable hello_world
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-mlock.o): in function `__malloc_lock':
    [ INFO] mlock.c:(.text.__malloc_lock+0x4): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-mlock.o): in function `__malloc_unlock':
    [ INFO] mlock.c:(.text.__malloc_unlock+0x4): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-puts.o): in function `.L2':
    [ INFO] puts.c:(.text._puts_r+0x5c): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-puts.o): in function `.L5':
    [ INFO] puts.c:(.text._puts_r+0xac): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-vfprintf.o): in function `.L2':
    [ INFO] vfprintf.c:(.text._vfprintf_r+0x7c): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-vfprintf.o): in function `.L5':
    [ INFO] vfprintf.c:(.text._vfprintf_r+0xd2): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-vfprintf.o): in function `.L6':
    [ INFO] vfprintf.c:(.text._vfprintf_r+0x110): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-vfprintf.o): in function `.L72':
    [ INFO] vfprintf.c:(.text._vfprintf_r+0x6e4): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-vfprintf.o): in function `__sbprintf':
    [ INFO] vfprintf.c:(.text.__sbprintf+0x4e): undefined reference to `_lock_init_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: vfprintf.c:(.text.__sbprintf+0x8c): undefined reference to `_lock_close_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-__atexit.o): in function `.L0 ':
    [ INFO] __atexit.c:(.text.__register_exitproc+0x12): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: __atexit.c:(.text.__register_exitproc+0x44): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-__atexit.o): in function `.L6':
    [ INFO] __atexit.c:(.text.__register_exitproc+0x9a): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-__call_atexit.o): in function `.L0 ':
    [ INFO] __call_atexit.c:(.text.__call_exitprocs+0x1c): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: __call_atexit.c:(.text.__call_exitprocs+0x50): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/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+0x3e): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-fflush.o): in function `.L49':
    [ INFO] fflush.c:(.text._fflush_r+0x66): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-findfp.o): in function `.L0 ':
    [ INFO] findfp.c:(.text.std+0x68): undefined reference to `_lock_init_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-findfp.o): in function `__sfp_lock_acquire':
    [ INFO] findfp.c:(.text.__sfp_lock_acquire+0x4): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-findfp.o): in function `__sfp_lock_release':
    [ INFO] findfp.c:(.text.__sfp_lock_release+0x4): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-findfp.o): in function `__sinit_lock_acquire':
    [ INFO] findfp.c:(.text.__sinit_lock_acquire+0x4): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-findfp.o): in function `__sinit_lock_release':
    [ INFO] findfp.c:(.text.__sinit_lock_release+0x4): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-fclose.o): in function `.L3':
    [ INFO] fclose.c:(.text._fclose_r+0x38): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-fclose.o): in function `.L4':
    [ INFO] fclose.c:(.text._fclose_r+0x52): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-fclose.o): in function `.L9':
    [ INFO] fclose.c:(.text._fclose_r+0xcc): undefined reference to `_lock_release_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-fclose.o): in function `.L11':
    [ INFO] fclose.c:(.text._fclose_r+0xd6): undefined reference to `_lock_close_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/lib\libc.a(lib_a-fputwc.o): in function `_fputwc_r':
    [ INFO] fputwc.c:(.text._fputwc_r+0x2e): undefined reference to `_lock_acquire_recursive'
    [ INFO] n:/bitcoin/kendryteide/localpackage/toolchain/bin/../lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/bin/ld.exe: fputwc.c:(.text._fputwc_r+0x7a): undefined reference to `_lock_release_recursive'
    [ INFO] collect2.exe: error: ld returned 1 exit status
    [ INFO] make.exe[2]: *** [CMakeFiles/hello_world.dir/build.make:99: hello_world] Error 1
    [ INFO] make.exe[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/hello_world.dir/all] Error 2
    [ INFO] make.exe: *** [Makefile:84: all] Error 2
    [ INFO] 
    [ INFO] Build Error: N:/bitcoin/KendryteIDE/LocalPackage/cmake/bin/cmake.exe exited with code 2.
    
    [ERROR] Build failed.
    Error: 编译失败,返回2
        at CMakeService.<anonymous> (file:///N:/bitcoin/KendryteIDE/Application/app_1.34.1-alpha_20190612.2/resources/app/out/vs/workbench/workbench.main.js:97656:27)
        at Generator.next (<anonymous>)
        at fulfilled (file:///N:/bitcoin/KendryteIDE/Application/app_1.34.1-alpha_20190612.2/resources/app/out/vs/workbench/workbench.main.js:2304:58)
        at process._tickCallback (internal/process/next_tick.js:68:7)
    [ERROR] Build failed.

  • |  Mod

    只编译c或cpp其中一种有没有这种问题?