Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Ask your questions right here!
  3. Ceres c++ error when used in voxl2 project

Ceres c++ error when used in voxl2 project

Scheduled Pinned Locked Moved Ask your questions right here!
9 Posts 2 Posters 844 Views 1 Watching
  • 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.
  • L Offline
    L Offline
    lfierz
    wrote on last edited by
    #1

    Hi there

    I am running a structure from motion pipeline on voxl2 and this pipeline needs in a prior step the bundle adjustment solver Ceres. I know that on voxl this pipeline worked but now for some reason on voxl2 I can build Ceres but when building the project that depends on Ceres I get an error saying that the std::vector = operator is an undefined reference. (see attached image)

    Screenshot from 2023-11-20 15-33-21.png

    Any ideas how to resolve this? I tried moving from c++ 11 in the cmake to c++14 but I think that's a bad approach as the assignment operator for std::vectors was introduced in c++ 98. I also tried using a specific voxl Ceres that I built using voxl docker but that yielded many other errors indicating a doubtful implementation.

    Any ideas how to resolve this? Thanks in advance.

    Alex KushleyevA 1 Reply Last reply
    0
    • L lfierz

      Hi there

      I am running a structure from motion pipeline on voxl2 and this pipeline needs in a prior step the bundle adjustment solver Ceres. I know that on voxl this pipeline worked but now for some reason on voxl2 I can build Ceres but when building the project that depends on Ceres I get an error saying that the std::vector = operator is an undefined reference. (see attached image)

      Screenshot from 2023-11-20 15-33-21.png

      Any ideas how to resolve this? I tried moving from c++ 11 in the cmake to c++14 but I think that's a bad approach as the assignment operator for std::vectors was introduced in c++ 98. I also tried using a specific voxl Ceres that I built using voxl docker but that yielded many other errors indicating a doubtful implementation.

      Any ideas how to resolve this? Thanks in advance.

      Alex KushleyevA Offline
      Alex KushleyevA Offline
      Alex Kushleyev
      ModalAI Team
      wrote on last edited by
      #2

      @lfierz , this could happen if you built Ceres using a different build environment (different version of gcc / libstdc++). Are you building Ceres and your project natively on VOXL2 with the same C++ dialect?

      Alex

      L 1 Reply Last reply
      0
      • Alex KushleyevA Alex Kushleyev

        @lfierz , this could happen if you built Ceres using a different build environment (different version of gcc / libstdc++). Are you building Ceres and your project natively on VOXL2 with the same C++ dialect?

        Alex

        L Offline
        L Offline
        lfierz
        wrote on last edited by
        #3

        @Alex-Kushleyev I'm not exactly sure what to look for when looking for the c++ dialect used. There are no CXX_STANDARD statements in either CMakeLists.txt file. So I suppose they are both using the default (don't know what that is).

        My project does use C++14 while Ceres 1.14 which I try to include uses c++11 but I tried with c++14 there as well as mentioned previously yielding the same error.

        Alex KushleyevA 1 Reply Last reply
        0
        • L lfierz

          @Alex-Kushleyev I'm not exactly sure what to look for when looking for the c++ dialect used. There are no CXX_STANDARD statements in either CMakeLists.txt file. So I suppose they are both using the default (don't know what that is).

          My project does use C++14 while Ceres 1.14 which I try to include uses c++11 but I tried with c++14 there as well as mentioned previously yielding the same error.

          Alex KushleyevA Offline
          Alex KushleyevA Offline
          Alex Kushleyev
          ModalAI Team
          wrote on last edited by
          #4

          @lfierz also please double check that you are linking against libstdc++ ..

          Additionally, since it seems you are using a static library libceres.a , with static libraries, the link order matters, so make sure that -lstdc++ is after -lceres in your link command.

          L 2 Replies Last reply
          0
          • Alex KushleyevA Alex Kushleyev

            @lfierz also please double check that you are linking against libstdc++ ..

            Additionally, since it seems you are using a static library libceres.a , with static libraries, the link order matters, so make sure that -lstdc++ is after -lceres in your link command.

            L Offline
            L Offline
            lfierz
            wrote on last edited by
            #5

            @Alex-Kushleyev Thanks for the hint. I now added the stdc++ to the linked libs like so:
            target_link_libraries(${PROJECT_NAME}_tracker_node stdc++ ${CERES_LIBRARIES})
            It still yields the same error sadly. I also tried linking stdc++ in a separate target_link_libraries statement which also yielded the same error.

            Alex KushleyevA 1 Reply Last reply
            0
            • Alex KushleyevA Alex Kushleyev

              @lfierz also please double check that you are linking against libstdc++ ..

              Additionally, since it seems you are using a static library libceres.a , with static libraries, the link order matters, so make sure that -lstdc++ is after -lceres in your link command.

              L Offline
              L Offline
              lfierz
              wrote on last edited by lfierz
              #6

              @Alex-Kushleyev I'm quite sure that I use the g++ compiler for both builds. neither clang nor msvc are installed.

              1 Reply Last reply
              0
              • L lfierz

                @Alex-Kushleyev Thanks for the hint. I now added the stdc++ to the linked libs like so:
                target_link_libraries(${PROJECT_NAME}_tracker_node stdc++ ${CERES_LIBRARIES})
                It still yields the same error sadly. I also tried linking stdc++ in a separate target_link_libraries statement which also yielded the same error.

                Alex KushleyevA Offline
                Alex KushleyevA Offline
                Alex Kushleyev
                ModalAI Team
                wrote on last edited by Alex Kushleyev
                #7

                @lfierz said in Ceres c++ error when used in voxl2 project:

                target_link_libraries(${PROJECT_NAME}_tracker_node stdc++ ${CERES_LIBRARIES})

                please try to switch link order of the libraries, specifically:

                target_link_libraries(${PROJECT_NAME}_tracker_node ${CERES_LIBRARIES} stdc++)
                

                The static libraries should come first. see https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc

                also, if you enable verbose cmake, you can actually see the linker command and make sure it has -lceres -lstdc++ in that order

                Alternatively.. if you build Ceres as dynamic library, it should figure out the dependencies at run time..

                L 1 Reply Last reply
                0
                • Alex KushleyevA Alex Kushleyev

                  @lfierz said in Ceres c++ error when used in voxl2 project:

                  target_link_libraries(${PROJECT_NAME}_tracker_node stdc++ ${CERES_LIBRARIES})

                  please try to switch link order of the libraries, specifically:

                  target_link_libraries(${PROJECT_NAME}_tracker_node ${CERES_LIBRARIES} stdc++)
                  

                  The static libraries should come first. see https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc

                  also, if you enable verbose cmake, you can actually see the linker command and make sure it has -lceres -lstdc++ in that order

                  Alternatively.. if you build Ceres as dynamic library, it should figure out the dependencies at run time..

                  L Offline
                  L Offline
                  lfierz
                  wrote on last edited by
                  #8

                  @Alex-Kushleyev building Ceres as a dynamically linked library solved it. You are hero material thank you!

                  Alex KushleyevA 1 Reply Last reply
                  0
                  • L lfierz

                    @Alex-Kushleyev building Ceres as a dynamically linked library solved it. You are hero material thank you!

                    Alex KushleyevA Offline
                    Alex KushleyevA Offline
                    Alex Kushleyev
                    ModalAI Team
                    wrote on last edited by
                    #9

                    @lfierz , excellent! I am glad that it worked 🙂

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    ModalAI
                    Categories Recent Tags ModalAI.com Docs
                    © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups