Skip to content

ld error during catkin build #35

@Hustwireless

Description

@Hustwireless

When I tried to build the project with catkin build, it returns error like this:

/usr/bin/ld: CMakeFiles/ros_package_template.dir/src/RosPackageTemplate.cpp.o: undefined reference to symbol '_ZTVN10__cxxabiv121__vmi_class_type_infoE@@CXXABI_1.3'
/usr/bin/ld: /lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

After I searched the Internet, I found that it is probably because cmake didn't use the right compiler. See this https://stackoverflow.com/questions/59536040/libstdc-so-6-error-adding-symbols-dso-missing-from-command-line
I think it might need to add a line like this in the CMakeLists.txt

set(CMAKE_CXX_COMPILER "/path/to/g++")

or simply modify the project line to

project(ros_package_template CXX)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions