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

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

问题描述

简短版本:
如果在发行模式下运行VS2008中的程序,我希望它使用
pathA\externaldll.dll
如果在调试模式下从VS2008运行程序,我希望它使用
pathB\externaldll.dll

长版本:
我有一个与外部dll文件(VTK)链接的程序。我已经在Debug和Release模式下自己构建了外部应用程序。外部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变量,如: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.

这个问题在这里回答了几次,我只是没有找到
(例如如何在visual studio中设置路径?

The question was answered several times here, I just didn't find it (e.g. How do I set a path in visual studio?)

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

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