_ZNSt8__detail15_List_node_base7_M_hookEPS0_ symbol, GLIBCXX_3.4.15 version is not defined in libstdC ++ file. so.6 with link link

I have compiled the below code on a compiler with the specified configuration. The compilation was successful. But the above error when doing ldd -r my_executable

#include <iostream>
#include <list>
using namespace std;

int main()
{
    list<int> mylist;
    mylist.push_back(1);
    mylist.push_back(2);
    mylist.push_back(3);

    cout << "\nList:\n";
    for(list<int>::iterator it = mylist.begin(); it != mylist.end(); it++)
    {
        cout << *it << "\n";
    }
}

      

Compiling machine parts: glibc version 2.14.1 libstdC ++ version GLIBCXX_3.4.16 (output after running the command: lines / usr / lib / libstdc ++. So.6 | grep LIBCXX)

Target device details: glibc version 2.12.90 libstdC ++ version GLIBCXX_3.4.14 (output after running command: lines / usr / lib / libstdc ++. So.6 | grep LIBCXX)

+3


source to share


1 answer


You have created your program on a machine with one version of GCC, so your program depends on shared libraries from that version of GCC, then you try to run it on a machine with an old version of GCC, which does not have the required shared libraries.



There are already hundreds of answers about this on StackOverflow. The simplest answer is to simply create the program on the target machine, so it is built with the version of GCC that exists on the target machine.

+1


source







All Articles