AnsweredAssumed Answered

Linker Problem: undefined reference to `__errno'

Question asked by Daemy on Oct 22, 2015
Latest reply on Aug 23, 2017 by Ayoub Ayoub
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.0

but it comes up with a linker error :
w_sqrt.c:(.text.sqrt+0xa8): undefined reference to `__errno'
collect2.exe: error: ld returned 1 exit status

I'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, -Wl,--gc-sections -lm

Any ideas on how to resolve this would be welcome

TIA... Daemy

P.S. same project compiles without issue on a Keil/Arm compiler [but I don't have easy access to that :-( ]