在Visual Studio 2010 C ++中使用.dll [英] Using .dll in Visual Studio 2010 C++

查看:102
本文介绍了在Visual Studio 2010 C ++中使用.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题。我把我的.DLL和.LIB文件放在我的项目相同的目录,去属性 - >公共属性 - >框架和参考 - >添加新参考。

解决方案



/ div>

C ++不是C#。您不能通过添加引用在C ++应用程序中包括.dlls。除非它是C ++ / CLI,但不是C ++。



在C ++中,你将在项目配置中进入Linker-> Input-> Additional Dependencies。在这里,你会列出库名称加上有问题的.lib的路径。



通常,当你构建一个Windows C / C ++ DLL,你也会得到一个.lib 。这是一个导入库;库的用户包括(如上所述).lib以便访问DLL。他们一般不直接加载.dll(虽然有办法做到这一点)。


I have a problem. I place my .DLL and .LIB file in the same directory as my project, go to Properties -> Common Properties -> Framework and References -> Add New Reference. But the list comes up empty.

Is there something else I should be doing?

解决方案

C++ is not C#. You don't include .dlls in C++ applications by adding "references". Unless it's C++/CLI, but that's not C++.

In C++, you would go, in the project configuration, to Linker->Input->Additional Dependencies. There, you would list the library name plus path to the .lib in question.

Normally, when you build a Windows C/C++ DLL, you also get a .lib. This is an import library; users of the library include (as stated above) that .lib in order to access the DLL. They generally do not load the .dll directly (though there are ways to do that).

这篇关于在Visual Studio 2010 C ++中使用.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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