Visual Studio 2008:使用外部Debug-DLL用于Debug-Run和外部Release-DLL用于Release-Run [英] Visual Studio 2008: Use external Debug-DLL for Debug-Run and external Release-DLL for Release-Run

查看:180
本文介绍了Visual Studio 2008:使用外部Debug-DLL用于Debug-Run和外部Release-DLL用于Release-Run的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

短版本:
如果从发布模式下运行程序从VS2008,我想要使用
pathA\externaldll.dll
如果在Debug模式下从VS2008运行程序,我想要使用
pathB\externaldll.dll

长版本:
我有一个与外部dll文件(VTK)链接的程序。我已经构建外部应用程序自己在调试和发布模式。外部dll文件的位置如下:

Long version: I have a programm that is linked against external dll-files (VTK). I have built the external application myself in both Debug and Release mode. The external dll-files are located like this:

<some path>\Debug\externalDll.dll
<some path>\Release\externalDll.dll

,但有不同的文件夹)。

(so they are called the same, but have different folders).

我想进入Debug Builds的外部代码,但我想Release Builds使用Release DLL来测试执行时间(我处理大数据集)。

I want to step into the external code for Debug Builds, but I want the Release Builds to use the Release DLLs for testing the execution time (I process big datasets).

链接到相应的dll很容易,因为我有项目设置。但是当执行时,Visual Studio会获取在PATH环境变量中找到的第一个dll。

Linking to the according dlls is easy, as I have project settings for that. But when executing, Visual Studio takes the first dll it finds within the PATH environment variable.

麻烦的解决方案:
PATH变量like:PATH =;%CURRENTDLLPATH%;
并在后构建步骤中设置CURRENTDLLPATH。
VS2008中没有内置解决方案?

Cumbersome solution idea: Having the PATH variable like: PATH=;%CURRENTDLLPATH%; and setting CURRENTDLLPATH in a post-build-step. Is there no solution built-in into VS2008?

推荐答案

实际上有一个内置的和简单的方法:

Actually there is a built-in and easy way:

环境 - 项目设置中的变量/调试。

The "Environment"-Variable within "project settings"/Debugging.

PATH=C:\Paraview\ParaView-3.8.0\gen\bin\$(ConfigurationName);%PATH%

要执行的项目就是这样。

for the project to be exectued does the trick.

问题在这里回答了几次,我只是没有找到
(例如 http://stackoverflow.com/questions/428085/how-do-i-set-a-path-in-visual-studio

The question was answered several times here, I just didn't find it (e.g. http://stackoverflow.com/questions/428085/how-do-i-set-a-path-in-visual-studio)

这篇关于Visual Studio 2008:使用外部Debug-DLL用于Debug-Run和外部Release-DLL用于Release-Run的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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