简体   繁体   English

在另一个 DLL 中使用 DLL

[英]Using DLL in another DLL

So I created a DLL(dll1) in visual studio 2022, which uses another DLL(dll2).所以我在 Visual Studio 2022 中创建了一个 DLL(dll1),它使用了另一个 DLL(dll2)。 But whenever I try to use dll2's functions with including dll1, the executable just stops at that point但是每当我尝试使用包含 dll1 的 dll2 函数时,可执行文件就会停止

for example:例如:

dll2 has a function named dll2func1() and dll2func2() dll2 有一个名为 dll2func1() 和 dll2func2() 的 function

dll1 includes dll2 and has a function like this: dll1 包括 dll2 并且有一个 function 像这样:

    dll1func1(){
        cout << "started" << endl;
        dll2func1();
        cout << "dll2func1 used" << endl;
        dllfunc2();
        cout << "dll2func2 used, end of function" << endl;
        }

when I use dll1func1() in my program, it only prints "started" and continuing while outputting nothing else.当我在我的程序中使用 dll1func1() 时,它只打印“开始”并继续,而没有输出任何其他内容。

How can I solve this?我该如何解决这个问题?

So I already linked the include directory and DLL2 location, also DLL2.dll to Additional Dependencies to DLL1.所以我已经将包含目录和 DLL2 位置以及 DLL2.dll 链接到 DLL1 的附加依赖项。 It turned out there was no problem there, it was with the project I tried to run.事实证明那里没有问题,这是我试图运行的项目。

Basically I properly linked include directories, dll locations and updated additional dependencies of the project with DLL1 and DLL2.基本上,我正确链接了包含目录、dll 位置,并使用 DLL1 和 DLL2 更新了项目的其他依赖项。

No problem there about linking a dll to a dll, actually sorry for that.将 dll 链接到 dll 没有问题,对此真的很抱歉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM