我现在需要将以前的VC6工程移植到VS2008,当编译这个MFC DLL时,就出错啦!1>c:\program files\microsoft sdks\windows\v6.0a\include\sdkddkver.h(217) :
fatal error C1189: #error : _WIN32_WINNT settings conflicts with _WIN32_IE setting 
很明显宏定义有问题!于是我首先尝试改了以下:由于在本工程中,找不到任何有定义_WIN32_WINNT的地方,所以只好手到在stdafx.h中加上以下几句:
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif但是还是报同样的错误。于是我删除了VS2008里面,新的SDK头文件的路径记录,但还是同样的错误~~请问哪位兄弟遇到过这个问题呀,不盛感激!另外,希望能讲解一下这个错误的原因!

解决方案 »

  1.   

    找到这样一篇文章,但还是没什么用~~从VC6到VC9移植代码问题总结
    http://blog.csdn.net/orbit/archive/2008/11/28/3405309.aspx
      

  2.   

    This is really a problem under VS 2008, which is going to be supported in the next version only.
    Workaround:
    Create a targetver.h file:
    #pragma once// The following macros define the minimum required platform. The minimum required platform
    // is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
    // your application. The macros work by enabling all features available on platform versions up to and
    // including the version specified.// Modify the following defines if you have to target a platform prior to the ones specified below.
    // Refer to MSDN for the latest info on corresponding values for different platforms.
    #ifndef WINVER // Specifies that the minimum required platform is Windows 2000.
    #define WINVER 0x0500 // Change this to the appropriate value to target other versions of Windows.
    #endif#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows 2000.
    #define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows.
    #endif#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows Me.
    #define _WIN32_WINDOWS 0x0500 // Change this to the appropriate value to target Windows Me or later.
    #endif#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 5.5.
    #define _WIN32_IE 0x0550 // Change this to the appropriate value to target other versions of IE.
    #endifRemove the problematic parts from stdafx.h, and include targetver. Since VS 2008 is not supported, other problems may come up.
      

  3.   

    魔法师:编译器混淆了不同版本的SDK 卸掉一个试试
      

  4.   

    多谢,我先卸载试试!Microsoft Platform SDK for Windows Server 2003 R2
    Microsoft Windows SDK v6.0A
      

  5.   

    整个stdafx.h文件的内容是怎么样的。
      

  6.   

    fatal error C1189: #error :  _WIN32_WINNT settings conflicts with _WIN32_IE setting
    我也是同样的问题啊!
    是在写directshow时出现的故障
      

  7.   

    5.1. C\C++ - General - Debug Information Format = Program Database (/Zi)
    5.2. C\C++ - Preprocessor - Preprocessor Definitions = _X86_ [add also DBG for Debug config]
    【WIN32;_DEBUG;_X86_;i386;STD_CALL;CONDITION_HANDLING;WIN32_LEAN_AND_MEAN;NT_UP;SRVDBG;DBG;_IDWBUILD;_WIN32_WINNT=0x0400;% (PreprocessorDefinitions)】设置为这个就好了 开始我也是
      

  8.   

    项目属性 -> c/c++ -> 预处理器 -> 预处理器定义,里面有一个_WIN32_WINNT=0x400,改为_WIN32_WINNT=0x0500就好了。不用改代码
      

  9.   

    驼背老人,您好!我看您的方法解决了10楼和11楼的问题!我也遇到了同样的问题,我用的VS2008,我没有在项目属性 -> c/c++ -> 预处理器 -> 预处理器定义里找到_WIN32_WINNT=0x400;只有个_WIN32;还不让改!麻烦请教一下!