Compile errors "undefined reference to 'lrintf' for RRF2
-
I am just trying to Build the code. CoreNG and FreeRTOS build fine. Then RepRapFirmware had a bunch of path issues which I fixed.
But now I get this error when compiling:
CartesianKinematics.cpp:(.text._ZNK19CartesianKinematics21CartesianToMotorStepsEPKfS1_jjPlb+0x20): undefined reference to `lrintf'plus many other similar errors for lrintf, pow, cosf, sinf, sqrtf, vApplicationTickHook, and maybe more.
I'm a bit of a novice, so any help is greatly appreciated!
-
If it helps, in the Cross G++ Linker settings, next to All Options is this editable text:
-L"/Users/John/Desktop/eclipse-workspace/CoreNG/SAM4E8E_RTOS" -L"/Users/John/Desktop/eclipse-workspace/FreeRTOS/SAM4E" -Os --specs=nano.specs -Wl,--gc-sections -Wl,--fatal-warnings -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -T"/Users/John/Desktop/eclipse-workspace/CoreNG/variants/duetNG/linker_scripts/gcc/flash.ld" -Wl,-Map,"/Users/John/Desktop/eclipse-workspace/RepRapFirmware/Duet2_RTOS/Duet2CombinedFirmware.map"
-
If someone has compiled RRF2 before, let me know what the command is right after this:
Building target: Duet2CombinedFirmware.elf
Invoking: Cross G++ LinkerMine is really long and starts with:
arm-none-eabi-gcc -L"/Users/.........and ends with:
....... ./src/ZProbeProgrammer.o -lCoreNG -lFreeRTOSI have a feeling the lower case L's arguments are not right, but not sure.
-
After the "-l" , should it be "CoreNG" and "FreeRTOS"? Or should it be an actual directory to CoreNG and the directory to FreeRTOS?
-
The -L options are the library paths, as set in the Libraries tab in the linked settings. The -l options are the library file names, also set in the Libraries tab.
The undefined symbols you listed are mostly supplied by the C maths library, which should have been installed with Gnu ARM Developer Tools and should be included by the linker automatically.
Which versions of Eclipse and Gnu ARM Developer Tools are you using?
-
Thank you dc42. On Mac, Eclipse Version: 2020-09 (4.17.0). The arm developer tools thing in my downloads folder is named:
gcc-arm-none-eabi-6-2017-q2-update -
However, when I look in Duet2CombinedFirmware.map, I see a line for llrint with the following text:llrint /usr/local/Caskroom/gcc-arm-embedded/7-2018-q2-update/gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard/libm.a(lib_a-s_llrint.o)edit: i was looking at an old file
-
@jml, try using a later version of Gnu ARM Developer Tools, but not the very latest one because that is a new major compiler version. The 2019 q4 version should be about right.
-
I have downloaded it and unzipped it. Then in RepRapFirmware Properties, C/C++ Build > Settings > Cross Settings, I changed the path to be to the unzipped folder:
/Users/John/Downloads/gcc-arm-none-eabi-9-2019-q4-major
(should there be a "/bin" at the end?)However, I get the exact same errors.
-
Also, should i be making the Cross Settings path to:
/Users/John/Downloads/gcc-arm-none-eabi-9-2019-q4-major/bin
for CoreNG, FreeRTOS, and RRF? I noticed FreeRTOS had a different path:
/usr/local/bin -
@jml said in Compile errors "undefined reference to 'lrintf' for RRF2:
Also, should i be making the Cross Settings path to:
/Users/John/Downloads/gcc-arm-none-eabi-9-2019-q4-major/bin
for CoreNG, FreeRTOS, and RRF? I noticed FreeRTOS had a different path:
/usr/local/binFor all projects except the WiFiServer projects, the files on github set it to {ArmGccPath}. You should not have changed that. ArmGccPath is a build variable set up in Window->Preferences, which you should set to that gcc-arm-none-eabi-9-2019-q4-major/bin folder as per the build instructions.
-
Ok they are no all set to gcc-arm-none-eabi-9-2019-q4-major/bin
Still the same errors persist. Here is another example error:
/Users/John/Downloads/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ScaraKinematics.cpp:(.text._ZNK15ScaraKinematics21MotorStepsToCartesianEPKlPKfjjPf+0x7e): undefined reference to `sinf'
If I actually go to the paths, I do see the right things in those folders. I'm on Mac by the way, so I wonder if that has anything to do with it?
-
For all projects except the WiFiServer projects, the files on github set it to {ArmGccPath}. You should not have changed that.
My bad - i was following old instructions that mentioned setting it to /usr/local/bin
-
Anyway, I've tried the new 2019 q4 major update, and it is not improving the results at all. Still lots of the same error like undefined reference to `pow'. Hmmmm