日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

VS2003转VS2010 fatal error C1189: #error

發布時間:2024/4/15 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 VS2003转VS2010 fatal error C1189: #error 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我自己的mfc的demo要轉換編譯環境出現以下編譯錯誤:

VS2010編譯錯誤:fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403...的解決方法

在google中找到解決辦法,

_WIN32_WINNT這個宏對應定義的系統的版本號,如果太低的話,編譯器就會認為代碼無法在當前的系統上編譯。

? 說了原因,下面是修改方法,就是在stdafx.h文件中修改相關的定義,修改完后的效果應該如下:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. #define WINVER 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. #endif #ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. #endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0501 // Change this to the appropriate value to target Windows Me or later. #endif #ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later. #define _WIN32_IE 0x0601 // Change this to the appropriate value to target IE 5.0 or later. #endif

但編譯后又出現以下問題:

1> stdafx.cpp 1>d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4024): error C2061: 語法錯誤: 標識符“PSCROLLBARINFO” 1>d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(184): error C2065: “PSCROLLBARINFO”: 未聲明的標識符 1>d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(184): error C2146: 語法錯誤: 缺少“)”(在標識符“pScrollInfo”的前面) 1>d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(184): error C2761: “BOOL CScrollBar::GetScrollBarInfo(void) const”: 不允許成員函數重新聲明 1>d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(184): error C2059: 語法錯誤:“)” 1>d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(185): error C2143: 語法錯誤 : 缺少“;”(在“{”的前面) 1>d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin4.inl(185): error C2447: “{”: 缺少函數標題(是否是老式的形式表?)

  比較郁悶。。。。

#ifndef WINVER // 允許使用 Windows 95 和 Windows NT 4 或更高版本的特定功能。 //#define WINVER 0x0400 //為 Windows98 和 Windows 2000 及更新版本改變為適當的值。 剛剛此處沒有修改 #define WINVER 0x0501 #endif

  現在應該正常。

參考網友:

http://www.cnblogs.com/madhenry/archive/2011/06/29/2093678.html

http://blog.csdn.net/cs_21cn/article/details/7925455

?

轉載于:https://www.cnblogs.com/logy/p/3358484.html

總結

以上是生活随笔為你收集整理的VS2003转VS2010 fatal error C1189: #error的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。