简体   繁体   English

如何在 Visual Studio 中设置依赖 DLL 路径?

[英]How to set dependency DLL paths in Visual Studio?

I am working with Cyclone DDS, and they have two builds, c build (contains multiple files in the bin folder)我正在使用Cyclone DDS,他们有两个版本,c 版本(包含 bin 文件夹中的多个文件)

在此处输入图像描述

and c++ build (contains DLL file in the bin)和 c++ 构建(在 bin 中包含 DLL 文件)

在此处输入图像描述

after Cyclones DDS installation, I have to set these bin paths in system environment variables.安装 Cyclones DDS 后,我必须在系统环境变量中设置这些 bin 路径。

how can I avoid this?我怎样才能避免这种情况? I need to set them in the visual studio 2017 itself.我需要将它们设置在 Visual Studio 2017 本身中。 without setting paths in the system environment无需在系统环境中设置路径

or can I copy bin files into my project directory?或者我可以将 bin 文件复制到我的项目目录中吗? so that I can use the project file on any PC which has visual studio 2017 without reinstalling CycloneDDS?这样我就可以在任何具有 Visual Studio 2017 的 PC 上使用项目文件,而无需重新安装 CycloneDDS?

Windows by default will prefer .DLL files in the same directory as the .EXE .默认情况下,Windows 更喜欢与.EXE位于同一目录中的.DLL文件。 So while developing, you can put them in your Visual Studio Debug and Release folders.因此,在开发过程中,您可以将它们放在您的 Visual Studio 调试和发布文件夹中。 For other people, you include the DLL's in the installer.对于其他人,您将 DLL 包含在安装程序中。

The exception is the *140.dll stuff, for which you need the Visual C++ redistributable.例外是*140.dll的东西,你需要 Visual C++ 可再发行组件。 That's installed as part of Visual Studio 2017, but can also be distributed independently (hence the name).它作为 Visual Studio 2017 的一部分安装,但也可以独立分发(因此得名)。

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

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