c++ - 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.
解决方案
对于构建,您不需要DLL。
调试时,查看项目的每个配置属性,特别是顶级调试条目。
但是,您可能无论如何都不需要PATH
。它仅在查找 DLL 时用作最后的手段。搜索的第一个目录是应用程序目录,调试时将是x64\Debug
orx64\Release
文件夹。
我不确定您的 Python 脚本在做什么,但它以与 Windows 完全不同的方式寻找 DLL 听起来很奇怪。
推荐阅读
- php - 如何从同一网络上的 iPhone 访问 Mac localhost PHP 服务器上的网站?
- c# - Azure 突然阻止我访问我的数据库
- flask - 为 Dreamhost Flask 应用程序自动创建 tmp/restart.txt
- javascript - 如何从javascript中的url获取id?
- dynamic - 没有 STB_GNU_UNIQUE 的静态链接 stdc++ 在 dlclose 时导致内存泄漏
- powershell - PowerShell脚本查找数字,如果大于发送电子邮件
- sql - 如何将此 mysql 查询转换为在雪花/mpp 上运行
- java - Java "x += y" 和 "x = x+y" 产生不同的结果
- python-3.x - 使用 sqlite3 插入二进制数据
- azure - 身份验证不会重定向回我在 Xamarin.Forms 中的 Android 应用