C++ 在动态链接库 Core.dll 中找不到过程入口点

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1578950/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 20:31:01  来源:igfitidea点击:

The procedure entry point could not be located in the dynamic link library Core.dll

c++dllvisual-studio-2005singletonlinker

提问by stijn

I am converting my project to use DLLs and am trying to break apart my Singletonclass to avoid using templates.

我正在将我的项目转换为使用 DLL,并试图拆分我的Singleton类以避免使用模板。

My class, LudoMemory, originally inherited from Singleton. I am trying to give it the functions to destroy and create itself now and have my main engine not rely on the Singleton.

我的班级,LudoMemory最初继承自Singleton. 我正在尝试赋予它现在销毁和创建自身的功能,并使我的主引擎不依赖于Singleton.

I have written a simple destroy method like such:

我写了一个简单的销毁方法,如下所示:

LudoMemory *memory_Singleton = NULL;

    void LudoMemory::Destroy()
    {
        LUDO_SAFE_DELETE(m_Singleton)
    }

and upon running the program (no compiler errors) I recieve this error:

在运行程序(没有编译器错误)时,我收到了这个错误:

The procedure entry point ?Destroy@LudoMemory@@SAXXZ could not be located in the dynamic link library LudoCore.dll

过程入口点 ?Destroy@LudoMemory@@SAXXZ 无法在动态链接库 LudoCore.dll 中定位

LudoCoreis the project that LudoMemorybelongs to. Why is this happening? How can I solve it?

LudoCoreLudoMemory属于的项目。为什么会这样?我该如何解决?

回答by stijn

you don't have multiple versions of ludocore.dll on your system, do you? Procedure entry points errors usually mean: you compiled your project against ludocore.lib version x, and when running the program, it uses ludocore.dll version y, and version y does not define LudoMemory::Destroy().

你的系统上没有多个版本的 ludocore.dll ,是吗?过程入口点错误通常意味着:您针对 ludocore.lib 版本 x 编译您的项目,并且在运行程序时,它使用 ludocore.dll 版本 y,而版本 y 没有定义 LudoMemory::Destroy()。

回答by abelenky

Jacob's answer about multiple DLL versions seems likely.

雅各布关于多个 DLL 版本的回答似乎很可能。

Also, with some build systems, you must explicitly list which functions will be exported in a DLL.

此外,对于某些构建系统,您必须明确列出将在 DLL 中导出的函数。

Research your build environment, and see if you must provide a list of methods to be exported as an entry-point.

研究您的构建环境,看看您是否必须提供要作为入口点导出的方法列表。

回答by SridharKritha

In Visual Studio build environment, also you could try by disabling the References in Linker Optimization Settings [ No(/OPT:NOREF)]

在 Visual Studio 构建环境中,您也可以尝试禁用链接器优化设置中的引用 [ No(/OPT:NOREF)]