我如何调用 C++来自VS2008的dll

发布于 2024-09-26 18:57:31 字数 371 浏览 0 评论 0原文

好吧,我已经使用 CP 的 文章 创建了一个 DLL。为了创建这个 DLL,我也使用了 VS2008。现在我不知道如何从 VS2008 创建的另一个 C++ 应用程序调用这个 DLL。当我单击Refrences>Add New Reference 时,这要求提供项目文件夹而不是 DLL 路径。

在代码项目文章中,有几个步骤用于添加预处理器和设置链接到库。我不太确定该怎么做?

Well I have created a DLL using the Article from CP. For creating this DLL aslso, I have used VS2008. Now I am not sure how can I call this DLL from another C++ application created in VS2008. When I click on Refrences>Add New Reference this is asking for the project folder not for the DLL path.

In the Code Project article , there are few steps for Adding Preproccessor and setting up the link to the lib. I am not quite sure how to go about this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不奢求什么 2024-10-03 18:57:31

您是在谈论托管 DLL (.NET)吗?只有这样你才需要做“添加新参考”的事情。

如果不:
与您的 DLL 一起创建了一个扩展名为“.lib”的文件(导入库)。
将其添加到调用应用程序的项目中,例如在项目设置中:
“配置属性”-“链接器”-“输入”-“附加依赖项”。

在源代码中添加#include ".h"

Are you talking about a managed DLL (.NET)? Only then you need to do the "Add New Reference" stuff.

If not:
Together with your DLL a file with the extension ".lib" has been created (the import lib).
Add it to your project of the calling application e.g. in the project settings:
"Configuration Properties" - "Linker" - "Input" - "Additional Dependencies".

In your source code add #include "<name of the headerfile for your DLL>.h".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文