Visual Studio新调试配置 [英] Visual Studio New Debug Configuration

查看:418
本文介绍了Visual Studio新调试配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试配置Visual Studio 2010,添加一个Debug配置。



配置管理器 - >通过从活动的解决方案配置开始:或Project,添加新的,创建一个新的配置,从Debug ...复制(如果解决方案,创建新配置,或刚刚使用Debug并添加新项目配置)...



http://msdn.microsoft.com/en-us/library/kwybya3w .aspx



Build - >建议混合使用Debug和Release的错误:



defaultlib LIBCMT与其他库的使用冲突;使用/ NODEFAULTLIB:库 - >易于修复



_ITERATOR_DEBUG_LEVEL检测到不匹配:值2与值0不匹配 - >不知道如何修复。



我试图手动更改项目文件...但是我不知道如何解决这个问题。



更重要的是,我可以不仅仅是解决了这个具体的例子 - 这种情况会再次出现很多很多情况,所以我做错了什么?



注意:为了能够进行单元测试(c ++),我需要一个DEBUG配置,并能够将构建可执行文件与单元测试分开。

解决方案

我可以在属性表中设置配置选项,我可以在其中添加如

 < ItemDefinitionGroup Condition ='$(Configuration)'=='DebugCopy'> 
< ClCompile>
<预处理器定义> _ITERATOR_DEBUG_LEVEL = 2;%(预处理器定义)< / PreprocessorDefinitions>
< / ClCompile>
< / ItemDefinitionGroup>

(以及我需要的任何其他选项,默认情况下可能不会设置)。 >

这是一种方法来覆盖我所使用的所有项目强加的一些全局设置,这导致了我所遇到的错误(主要是因为我不知道这些设置)。


I am trying to configure Visual Studio 2010, to add a Debug configuration.

Configuration Manager->either by starting in the active solution configuration:, or Project, added New, created a New configuration, copied from Debug... (if solution, either created new configuration, or just used Debug and added new project configuration)...

http://msdn.microsoft.com/en-us/library/kwybya3w.aspx

Build -> errors that suggest a mix of Debug and Release:

defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library -> easy to fix

mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' -> don't know how to fix.

I tried to manually change the project file... But I don't know how to fix this.

What is more, I can't just fix this specific instance - there will be lots and lots of situations where this situation will happen again, so, what am I doing wrong ?

Note: I need a DEBUG configuration in order to be able to do unit testing (c++), and be able to separate building executables from unit tests.

解决方案

I can set the configuration options in a property sheet, where I can add things like

<ItemDefinitionGroup Condition="'$(Configuration)' == 'DebugCopy'">
    <ClCompile>
      <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
  </ItemDefinitionGroup>

(as well as any other options I require that may not be set by default).

It is a way to override some global settings that have been imposed on all projects I am using, which have caused the bug I had (mostly because I wasn't aware of those settings).

这篇关于Visual Studio新调试配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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