We are using Code Warrior 10.6 for a Kinetis K51DN512. Our project is in C++.
I can compile all of our code. When it attempts to link, the linker errors out, with:
C:/Freescale/CW MCU v10.6/MCU/ARM_GCC_Support/ewl/lib/armv7e-m\libm.a(ansi_fp.o): In function `__num2dec':
ARM_GCC_Support/ewl/EWL_C/src/math/ansi_fp.c:1254: undefined reference to `__aeabi_d2iz'
Obviously, I am missing a library somewhere, but which library, and where?
Solved! Go to Solution.
One of our other guys found something.
__aeabi_d2iz lives in libgcc.a.
libgcc.a must be linked *AFTER* libm.a.
Adding "gcc" to the Linker | Libraries | Libraries pane after "m" fixed the problem.
We had a -lgcc in the Miscellaneous Linker Flags pane, which apparently caused libgcc.a to be linked BEFORE libm.a.
Hi John,
In menu Project > Properties > C/C++ Build > Settings > ARM Ltd Windows GCC C++ Compiler > Directories add "${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C++/include" and put the below paths at the end of the Compiler Directories list.
o "${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C++/include"
o "${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C/include"
Then in menu Project > Properties > C/C++ Build > Librarian check "Enable automatic library configurations" and choose "Model" = ewl_c++ / int / int.
Best regards,
Carlos
NO JOY.
Here are my current compiler include paths:
"C:\PVCS\Code\Throw Away Code\dradonly 5494711 Interface Adapter Operational SW\project\include"
"c:\Users\john_strohm\Desktop\freescale_50_usb_files\usb_core\"
"${ProjDirPath}/Project_Headers"
"${ProjDirPath}/Project_Settings/Startup_Code"
"${MCUToolsBaseDir}/ARM_GCC_Support/ewl/EWL_C++/include"
"${MCUToolsBaseDir}/ARM_GCC_Support/ewl/EWL_C/include"
"${MCUToolsBaseDir}/ARM_GCC_Support/ewl/EWL_Runtime/include"
"${ProjDirPath}/Generated_Code"
"${ProjDirPath}/Sources"
"${ProcessorExpertPath}/lib/Kinetis/iofiles"
"${ProcessorExpertPath}/lib/Kinetis/pdd/inc"
"${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C++/include"
"${MCUToolsBaseDir}/ARM_EABI_Support/ewl/EWL_C/include"
Librarian settings are as specified.
I still get:
Description | Resource | Path | Location | Type |
mingw32-make: *** [dradonly.elf] Error 1 | dradonly | C/C++ Problem | ||
ARM_GCC_Support/ewl/EWL_C/src/math/ansi_fp.c undefined reference to `__aeabi_d2iz' | dradonly | line 1254 | C/C++ Problem |
Hi John,
We'd need to reproduce this issue. Would you be so kind to submit a Service request at www.freescale.com/support and let us have a project (as simple as possible) where we can reproduce this behavior?
Best regards,
Carlos
Technical Support Engineer
One of our other guys found something.
__aeabi_d2iz lives in libgcc.a.
libgcc.a must be linked *AFTER* libm.a.
Adding "gcc" to the Linker | Libraries | Libraries pane after "m" fixed the problem.
We had a -lgcc in the Miscellaneous Linker Flags pane, which apparently caused libgcc.a to be linked BEFORE libm.a.
Thank you for sharing the answer John.
May I ask you to share a picture of your linker settings? This way other members may find this thread very useful.
Best regards,
Carlos
Thank you!