the meantime I tried different ways to override the compiler flags, but without success. I was in contact with the VisualMicro team, but no success too.
https://www.visualmicro.com/forums/YaBB ... 952506/0#2
Of course, I compiled everthing with the Nano Standard library.
As you recommended to contribute on this, since it is a community project, I suggest to replace the new definitions in this way:
Code: Select all
void* operator new(std::size_t sz)
{
void* ptr = std::malloc(sz);
#ifdef __cpp_exceptions
if (ptr)
{
return ptr;
}
else throw std::bad_alloc{};
#else
return ptr;
#endif
}
Do you see a way to prevent this linker error messsages, so that I can overload new and delete?Linking it all together ...
# Coping cached core C:\Users\RK_2\AppData\Local\Temp\VMBCore\arduino20x\0d0afcdd19ce3666a17ed0725e134254\core.a to C:\Users\RK_2\AppData\Local\Temp\VMBuilds\STM32-F303RE\STMicroelectronics_Nucleo_64\Release\core.a
"c:\Users\RK_2\AppData\Local\Arduino15\packages\STMicroelectronics\tools\xpack-arm-none-eabi-gcc\13.2.1-1.1/bin/arm-none-eabi-gcc" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -O0 -DNDEBUG -Wl,--defsym=LD_FLASH_OFFSET=0x0 -Wl,--defsym=LD_MAX_SIZE=524288 -Wl,--defsym=LD_MAX_DATA_SIZE=65536 -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common "-Wl,--default-script=c:\Users\RK_2\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.9.0\variants\STM32F3xx\F303R(D-E)T/ldscript.ld" "-Wl,--script=c:\Users\RK_2\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.9.0\system/ldscript.ld" "-Wl,-Map,C:\Users\RK_2\AppData\Local\Temp\VMBuilds\STM32-F303RE\STMicroelectronics_Nucleo_64\Release/STM32-F303RE.ino.map" -Wl,--no-warn-rwx-segments -o "C:\Users\RK_2\AppData\Local\Temp\VMBuilds\STM32-F303RE\STMicroelectronics_Nucleo_64\Release/STM32-F303RE.ino.elf" "-LC:\Users\RK_2\AppData\Local\Temp\VMBuilds\STM32-F303RE\STMicroelectronics_Nucleo_64\Release" -Wl,--start-group "STM32-F303RE.cpp.o" "SrcWrapper\syscalls.c.o" "SrcWrapper\HardwareTimer.cpp.o" "SrcWrapper\new.cpp.o" "SrcWrapper\HAL\stm32yyxx_hal.c.o" "SrcWrapper\HAL\stm32yyxx_hal_adc.c.o" "SrcWrapper\HAL\stm32yyxx_hal_adc_ex.c.o" "SrcWrapper\HAL\stm32yyxx_hal_can.c.o"
...
\Users\RK_2\AppData\Local\Temp\VMBCore\arduino20x\0d0afcdd19ce3666a17ed0725e134254\variant\variant_NUCLEO_F303RE.cpp.o" "C:\Users\RK_2\AppData\Local\Temp\VMBuilds\STM32-F303RE\STMicroelectronics_Nucleo_64\Release\core.a" -lc -Wl,--end-group -lm -lgcc -lstdc++
ld.exe: SrcWrapper\\new.cpp.o: in function operator new(unsigned int)
new.cpp*: (.text._Znwj+0x0): multiple definition of operator new(unsigned int); STM32-F303RE.cpp.o:STM32-F303RE.cpp:(.text._Znwj+0x0): first defined here
ld.exe: SrcWrapper\\new.cpp.o: in function operator delete(void*)
new.cpp*: (.text._ZdlPv+0x0): multiple definition of operator delete(void*); STM32-F303RE.cpp.o:STM32-F303RE.cpp:(.text._ZdlPv+0x0): first defined here
collect2.exe*: error: ld returned 1 exit status
Error linking for board Nucleo-64 (STMicroelectronics_Nucleo_64)
Build failed for project 'STM32-F303RE'
This would at least be a way to get the exceptions that I want to have.
Thanks
Richard