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

不打扰是莪最后的温柔 提交于 2019-12-22 06:35:22

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/13360014/the-procedure-entry-point-znst8-detail15-list-node-base7-m-hookeps0-could-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!