简体   繁体   中英

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.

For building, you don't need the DLL.

When debugging, look at the per-configuration properties of the project, in particular the top-level Debugging entry.

However, you probably don't need PATH anyway. It's only used as a last resort when finding DLL's. The first directory searched is the application directory, and when debugging that will be the x64\\Debug or x64\\Release folder.

I'm not sure what your Python script is doing, but it sounds weird that it's looking for DLLs in a way that's totally unlike Windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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