找不到过程入口点 [英] The procedure entry point could not be found

查看:86
本文介绍了找不到过程入口点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在编写 program.exe 的程序,它会加载一个dll lib.dll .当我在调试模式下运行 program.exe 时,一切正常.当我尝试以发布模式运行时,出现错误:

I have a program that I am writing program.exe, it loads a dll lib.dll. When I run program.exe in debug mode everything works fine. When I try to run in release mode I get an error:

过程入口点...无法在动态目录中找到链接库lib.dll .

当我在Dependency Walker中打开dll时,具有所有相同的奇怪符号的确切功能就在那里.我在Visual Studio中查看了模块窗口,以确保我没有从错误的目录加载dll,但事实并非如此.我使用相同的编译器(Visual Studio 2012)编译了dll和exe,所以这也不是问题.可能是什么原因造成的?

When I open the dll in dependency walker that exact function with all the same weird symbols is there. I looked at the module window in visual studio to make sure that I am not loading the dll from the wrong directory but that is not the case. I compiled both the dll and exe with the same compiler (Visual Studio 2012) so that is not the problem either. What could be causing this?

我将 lib.dll 转换为静态库,并且一切正常.我放弃!

I converted lib.dll into a static library and everything works fine. I give up!

推荐答案

我遇到了同样的问题,在我的情况下,这是由于我的计算机上安装了同一库的两个版本.

I ran into the same problem, and in my case, this was due to the fact that I had two versions of the same library installed on my computer.

最后,问题是我的PATH指向旧的DLL时,我将程序链接到新的LIB文件.如果LIB或DLL文件名中未包含库版本号,则混合版本非常容易.

In the end, the problem was that I was linking my program against the new LIB file while my PATH was pointing to the old DLL. When the library version number is not included in the LIB or DLL file names, it is very easy to mix the versions.

这篇关于找不到过程入口点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆