Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Compile errors "undefined reference to 'lrintf' for RRF2

    Scheduled Pinned Locked Moved
    Firmware installation
    2
    14
    758
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jmlundefined
      jml
      last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • jmlundefined
        jml
        last edited by

        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"

        1 Reply Last reply Reply Quote 0
        • jmlundefined
          jml
          last edited by

          If someone has compiled RRF2 before, let me know what the command is right after this:
          Building target: Duet2CombinedFirmware.elf
          Invoking: Cross G++ Linker

          Mine is really long and starts with:
          arm-none-eabi-gcc -L"/Users/.........

          and ends with:
          ....... ./src/ZProbeProgrammer.o -lCoreNG -lFreeRTOS

          I have a feeling the lower case L's arguments are not right, but not sure.

          1 Reply Last reply Reply Quote 0
          • jmlundefined
            jml
            last edited by

            After the "-l" , should it be "CoreNG" and "FreeRTOS"? Or should it be an actual directory to CoreNG and the directory to FreeRTOS?

            1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators
              last edited by dc42

              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?

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              1 Reply Last reply Reply Quote 0
              • jmlundefined
                jml
                last edited by

                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

                dc42undefined 1 Reply Last reply Reply Quote 0
                • jmlundefined
                  jml
                  last edited by jml

                  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

                  1 Reply Last reply Reply Quote 0
                  • dc42undefined
                    dc42 administrators @jml
                    last edited by

                    @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.

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    1 Reply Last reply Reply Quote 0
                    • jmlundefined
                      jml
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • jmlundefined
                        jml
                        last edited by jml

                        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

                        dc42undefined 1 Reply Last reply Reply Quote 0
                        • dc42undefined
                          dc42 administrators @jml
                          last edited by dc42

                          @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/bin

                          For 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.

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          jmlundefined 1 Reply Last reply Reply Quote 0
                          • jmlundefined
                            jml
                            last edited by

                            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?

                            1 Reply Last reply Reply Quote 0
                            • jmlundefined
                              jml @dc42
                              last edited by

                              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

                              1 Reply Last reply Reply Quote 0
                              • jmlundefined
                                jml
                                last edited by

                                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

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Unless otherwise noted, all forum content is licensed under CC-BY-SA