2015-10-22 09:20 AM
Hi,
I'm trying to get to grips with System Workbench for STM32 & STM32F429i-Disco board.I'm trying to build the STemWin_SampleDemo project for STM32F429I-Discovery, supplied in STM32Cube_FW_F4_V1.8.0but it comes up with a linker error :w_sqrt.c:(.text.sqrt+0xa8): undefined reference to `__errno'collect2.exe: error: ld returned 1 exit statusI've tried everything I can find suggested here & elsewhere ( mainly revolving around linking the math library with -lm, but this makes no difference.)I was kinda hoping that a project supplied by ST from their STMcube suite using the ST (supplied?) IDE would compile without issue so i could use it as a platform to work from.Other projects, including the 'STM32F429I-Discovery' demonstration project, (also using the STemWin library) build & link without issue.Linker Script: -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L..\..\..\..\..\..\..\..\Middlewares\ST\STemWin\Lib -specs=nosys.specs -specs=nano.specs -T''..\STM32F429NIHx_FLASH.ld'' -Wl,-Map=output.map -Wl,--gc-sections -lmAny ideas on how to resolve this would be welcomeTIA... DaemyP.S. same project compiles without issue on a Keil/Arm compiler [but I don't have easy access to that :( ]2016-12-13 04:04 AM
I had the same issue with SystemWorkbench. The solution that worked for me was simply to edit the project properties under C/C++ Build > Settings > Tool Settings > MCU GCC Linker > Libraries as follows:
- Uncheck 'Use C math library (-lm)'
- Add the math library manually to the libraries list by simply adding 'm'
This way the '-lm' part is moved to end of the make file instruction and it should compile properly.
2017-02-09 01:59 PM
Best Solution
2017-07-10 05:45 AM
THANK YOU!!!!!!!!!!
2017-08-23 05:22 AM
Best Solution