Warning This file includes at least one deprecated or antiquated header

來源:互聯網
上載者:User

     我是在IOS上用GDB編譯,也是包如下錯誤,參考這邊文章以後就OK了

把我得#include "deque.h" 改成

#include <deque>, warning消失


以下為轉載內容:

著作權聲明:轉載時請以超連結形式標明文章原始出處和作者資訊及本聲明
http://jadue.blogbus.com/logs/31168910.html

用DEV-C++編譯是總是有警告:



32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting
the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated. V-C++,

那麼你應該這樣(新標準)如下:

#include <iostream> //C++標頭檔,去掉.h 

#include <fstream> 

#include <cstdlib> //C標頭檔,在原有檔案名稱前加c,並去掉.h 

using namespace std; //包括std名字空間

int main() //main函數必須返回int型,不再支援void 



ofstream fout("output.dat", ios_base::binary); 

//在檔案操作中使用ios_base類代替早期的ios類 

return 0; //這一條語句何以省略 

}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.