This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Undefined C++ runtime symbols

Part Number: TDA4VM

Hello everyone,

I am using ti-processor-sdk-rtos-j721e-evm-08_02_00_05 and trying to create a new demo app under the vision_apps folder.

This app integrates some 3rd party libraries, which were built with gcc-arm-5.4.

Because of this issue I updated the compiler to gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu.

I set up the concerto files to include header folders and libraries for the external library and everything seems to run fine during the compile step.

Unfortunately, the linker reports several errors similar to "undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream()@GLIBCXX_3.4'" which makes me think that the c++ runtime is not being linked correcly.

If I look for example at the output of the linking step for the ptk_demos I see "Required system library libstdc++.so".

Somehow I am not able to tell the linker that libstdc++.so is also required by my demo, despite trying different concerto and make flags.

Can anyone provide some guidance or have some similar experience?

  • Hello Matteo,

    Can you please provide the changes that you have done to try to link libstdc++.so so that I can review?

    Regards,

    Lucas

  • Hello Lucas,

    thanks for replying.


    Under the tiovx folder I updated the psdkra_tools_path.mak file and changed the GCC_LINUX_ARM_ROOT variable to point to the new compiler I was using (gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu).

    I also modified several flags in the concerto file for my demo app to force the usage of C++:

    CPPFLAGS    := --std=c++11
    LFLAGS +=-stdlib=libstdc++

    None of these changes seemed to work.

    Eventually I managed to solve the issue by working around the concerto build system. I created a plain make file where I was linking the necessary pre-built PSDK libraries and the 3rd party libraries I needed.

    What I think was happening is that the concerto build system tells the linker to search for libstdc++.so in the targetFS/usr/lib folder (which comes from the Linux SDK default built image). The libstdc++.so in that folder does not contain any GLIBCXX symbol, which were instead required by the 3rd party libraries I needed to integrate. By letting the compiler link to the libs delivered with the compiler itself I got rid of the undefined references.

    The runtime deployed in the targetFS folder seems to be outdated compared to the one needed by the gcc-arm compiler delivered with the Linux RTOS SDK, at least for the C++ runtime needed by my demo application. I actually don't think the error is related to the compiler itself; I expect to have the same error if I use the gcc-arm-9.2 delivered with the SDK. I didn't look however at how to fix this on the concerto build system side.

    Best,
       Matteo

  • Hi Matteo,

    Thanks for clarifying.  Depending on how you had the concerto.mak file set up for your application, if you were including the vision_apps/apps/concerto_a72_inc.mak, it may have been using the paths to the targetFS/usr/lib as you said.  Given the new compiler path, you may need to include this in the LDIRS list of paths that are used for providing the library paths.

    Given that you have a workaround in place, do you require any further support on this ticket?

    Regards,

    Lucas

  • Hi Lucas,

    Thanks for the support, I'll close this ticket.

    Best,
       Matteo