如何添加外部本机依赖项dll? [英] How to add external native dependency dll?

查看:155
本文介绍了如何添加外部本机依赖项dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个项目。第一个是Windows Forms Application项目,第二个是类库项目。 Сlass图书馆项目可与 FANN 一起使用。 Windows窗体是启动项目。

I have two projects. First is a Windows Forms Application project and second is a class library project. Сlass library project works with FANN. Windows Forms is Startup Project.

我应该有 Fann.Net .dll和fanndoubleMT.dll 与FANN一起使用。我下载了这些库,并将它们放在解决方案根目录下的 lib 文件夹中。

I should have Fann.Net.dll and fanndoubleMT.dll to work with the FANN. I downloaded these libraries and put their in a folder lib, located in the root of the solution.

我将Fann.Net.dll添加为类库项目的外部dll。我编译了项目。我收到一个错误消息无法加载DLL'fanndoubleMT.dll'。我通过将fanndoubleMT.dll添加到Windows_Forms_Application\bin\Debug文件夹中来解决此错误。

I added Fann.Net.dll as external dll to the class library project. I compiled the project. I got an error that says "Unable to load DLL 'fanndoubleMT.dll'. I fixed this error by adding fanndoubleMT.dll to the folder Windows_Forms_Application\bin\Debug.

我认为这是解决该问题的好方法,因为我使用git,并且每次您需要将dll转移到新工作场所的此文件夹中时。

I think this is a terrible solution to the problem, because I use git, and every time you need to transfer dll to this folder on the new workplace.

此致,丹尼斯。

推荐答案

您可以尝试以下方法:


  1. 添加/现有项目,而不是添加引用。

  2. 使用添加为链接。

  3. 确保要复制该项目

  4. 完成。重建并测试。
  5. $在VS的库属性中,将构建操作设置为内容,将复制到输出目录设置为如果较新则复制。 b $ b
  1. Add/Existing Item, instead of Add Reference.
  2. Use Add As Link.
  3. Make sure the item is to be copied in build folder. In the property of the library in VS, set Build Action to Content and Copy to Output Directory to Copy if Newer.
  4. Done. Rebuild and test.

在链接 http://social.msdn.microsoft.com/For ums / zh-CN / 1b1b316a-8648-4243-a651-84de51fd2508 / reference-native-dll-from-managed-c-project?forum = vssmartdevicesvbcs

这篇关于如何添加外部本机依赖项dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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