首页 > 解决方案 > How to point to the right DLLs in different visual studio configurations?

问题描述

Let's say I have a visual studio project using some external code in A.lib and A.dll.

On Debug and Release configurations, I need to specify different link paths for A.lib such that both are linking the right library.

But how about DLLs? How do I specify them to take higher priority than the PATH system environment variable ?

The point is that I have a python script which uses the PATH env variable to get the release version of the DLL. I just need a way to override this and point to a different path of the DLL in visual studio and DEbug configuration.

标签: c++visual-studiodebuggingdll

解决方案


对于构建,您不需要DLL。

调试时,查看项目的每个配置属性,特别是顶级调试条目。

但是,您可能无论如何都不需要PATH。它仅在查找 DLL 时用作最后的手段。搜索的第一个目录是应用程序目录,调试时将是x64\Debugorx64\Release文件夹。

我不确定您的 Python 脚本在做什么,但它以与 Windows 完全不同的方式寻找 DLL 听起来很奇怪。


推荐阅读