MediaTek-Labs / mt3620_m4_software

mt3620_m4_driver
Other
33 stars 29 forks source link

"__dso_handle" related build error on MT3620_M4_Sample_Code/FreeRTOS/MT3620_RTApp_FreeRTOS_CPP #44

Open IvanLee-1 opened 1 year ago

IvanLee-1 commented 1 year ago

Hello, regarding the example for CPP(/MT3620_M4_Sample_Code/FreeRTOS/MT3620_RTApp_FreeRTOS_CPP) I changed the main.cpp as below to use the operator new().

`static void blink_task(void pParameters) { // DigitalOut led(gpio_led_green); DigitalOut led = new DigitalOut(gpio_led_green);

printf("Blink Task Started\n");

while (1)
{
    led->Write(0);
    vTaskDelay(pdMS_TO_TICKS(100));
    led->Write(1);
    vTaskDelay(pdMS_TO_TICKS(100));
}

}`

but, there is an error as below.

[build] FAILED: FreeRTOS_RTcore_CPP.out [build] cmd.exe /C "cd . && C:\PROGRA~2\ARMGNU~1\12DBAB~1.2RE\bin\AR10B2~1.EXE -std=gnu++14 -fno-common -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wall -g -nostartfiles -Wl,--no-undefined -Wl,-n -T "C:/lab1/mt3620_m4_work/MT3620_M4_Sample_Code/FreeRTOS/MT3620_RTApp_FreeRTOS_CPP/linker.ld" -specs=nano.specs -specs=nosys.specs CMakeFiles/FreeRTOS_RTcore_CPP.dir/main.cpp.obj CMakeFiles/FreeRTOS_RTcore_CPP.dir/C_/lab1/mt3620_m4_work/MT3620_M4_Sample_Code/OS_HAL/src/os_hal_gpio.c.obj CMakeFiles/FreeRTOS_RTcore_CPP.dir/C_/lab1/mt3620_m4_work/MT3620_M4_Sample_Code/OS_HAL/src/os_hal_uart.c.obj CMakeFiles/FreeRTOS_RTcore_CPP.dir/C_/lab1/mt3620_m4_work/MT3620_M4_Sample_Code/OS_HAL/src/os_hal_dma.c.obj -o FreeRTOS_RTcore_CPP.out lib/MT3620_M4_Driver/libMT3620_M4_Driver.a lib/MT3620_M4_Driver/lib/MT3620_M4_BSP/libMT3620_M4_BSP.a lib/MT3620_M4_Driver/MT3620_M4_BSP/FreeRTOS/libMT3620_M4_FreeRTOS.a && cd ." [build] c:/progra~2/armgnu~1/12dbab~1.2re/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~2/armgnu~1/12dbab~1.2re/bin/../lib/gcc/arm-none-eabi/12.2.1/thumb/v7e-m+fp/hard\libg_nano.a(libc_a-signalr.o): in function_getpid_r': [build] signalr.c:(.text._getpid_r+0x0): warning: _getpid is not implemented and will always fail [build] c:/progra~2/armgnu~1/12dbab~1.2re/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~2/armgnu~1/12dbab~1.2re/bin/../lib/gcc/arm-none-eabi/12.2.1/thumb/v7e-m+fp/hard\libg_nano.a(libc_a-signalr.o): in function _kill_r': [build] signalr.c:(.text._kill_r+0xe): warning: _kill is not implemented and will always fail [build] c:/progra~2/armgnu~1/12dbab~1.2re/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: FreeRTOS_RTcore_CPP.out has a LOAD segment with RWX permissions [build] c:/progra~2/armgnu~1/12dbab~1.2re/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/progra~2/armgnu~1/12dbab~1.2re/bin/../lib/gcc/arm-none-eabi/12.2.1/thumb/v7e-m+fp/hard\libstdc++_nano.a(eh_globals.o): in function_GLOBALsubIcxa_get_globals_fast': [build] eh_globals.cc:(.text.startup._GLOBALsubIcxa_get_globals_fast+0xc): undefined reference to __dso_handle' [build] c:/progra~2/armgnu~1/12dbab~1.2re/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: FreeRTOS_RTcore_CPP.out: hidden symbol__dso_handle' isn't defined [build] c:/progra~2/armgnu~1/12dbab~1.2re/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: final link failed: bad value [build] collect2.exe: error: ld returned 1 exit status [build] ninja: build stopped: subcommand failed.`

How can I fix this build error?

Thanks.