Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"the procedure entry point _ZNSt8_detail15_List_node_base7_M_hookEPS0_ could not be located in the dynamic link library libstdc -6.dll."

have a small problem. I have c++ code, it's linking to some libraries. I have previously (original)exe from the source code and that runs perfectly on first machine. And there is second machine, where I work on the source code, change it, etc. On the second machine, the build of that source code works fine, bud when I copy the second.exe and try tu run it on the first machine it displays error message

"the procedure entry point _ZNSt8_detail15_List_node_base7_M_hookEPS0_ could not be located in the dynamic link library libstdc++-6.dll."

One thing, second.exe is copied in the same folder as original.exe, so it should see the ddl 'cause the original dll is in the same folder as original.exe, shouldn't it? It's compiled with MinGW, working in NetBeans and in project properties, there are libraries add (via add library file) but the libstdc++-6.dll is not there added. libstdc++-6.dll is in the folder where original.exe

thx

like image 624
Ell Avatar asked Nov 13 '12 11:11

Ell


1 Answers

I had a very similar problem using MingW inside XP.

I have compiled a 12 klines C++ project using mingW; It runs fine within MSYS, but failed when called whithin a native cmd shell, claiming that the entry point Z_St8_detail15_and_so_on is missing inside libstdc++-6.dll.

Conversely, the simple following program ran in both MSYS and cmd :

#include <iostream>

using namespace std ;

class Hello {
  public:
  Hello() { cout << "Hello !" << endl ; }
} ;

Hello hello ;

int main (void) {}

It had to be compiled against libstdc++ (gcc -o hello hello.cpp -lstdc++), and of course the compilation failed if -lstdc++ was omitted. So the name mangling was likely not to be the only issue.

I searched for libstdc++-6.dll within the explorer, and I found out that there were two on my system : one that was installed within migw32, and another one that had been installed previously by a program who held its own version of the lib within its directories. But, it had modified the PATH so that its lib were found first !

I inserted the path where Mingw stood at the beginning of the PATH inside the current shell. Smth like:

set PATH=C:\mingw\bin;D:\msys\1.0\local\bin;%PATH%

and now everything runs fine !


Martin, I can't write in your comments, so I edit my message : You are about to be right. How windows does look for the DLLs is explained right here:

http://msdn.microsoft.com/en-en/library/7d83bc18%28v=vs.80%29.aspx

Cheers

like image 129
autret Avatar answered Sep 30 '22 01:09

autret