| 8 | 1/1 | 返回列表 |
| 查看: 1456 | 回復: 7 | |||
| 本帖產生 1 個 程序強帖 ,點擊這里進行查看 | |||
[交流]
【求助】一個程序,不同編譯器結果不同【已完結】 已有2人參與
|
|||
|
這個程序用VC編譯沒問題,但是用mingw develop studio編譯出現(xiàn)以下錯誤: In file included from C:\MinGWStudio\MinGW\include\c++\3.3.1\backward\iostream.h:31, from ggg.cpp:1: C:\MinGWStudio\MinGW\include\c++\3.3.1\backward\backward_warning.h:32:2: warning: #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 ggg.cpp: In function `char* fun(STRU*, int)': ggg.cpp:30: error: name lookup of `i' changed for new ISO `for' scoping ggg.cpp:22: error: using obsolete binding at `i' ggg.cpp: At global scope: ggg.cpp:45: error: `main' must return `int' ggg.cpp:45: error: return type for `main' changed to `int' ggg.o - 4 error(s), 1 warning(s) [ Last edited by nono2009 on 2010-11-11 at 07:31 ] |

|
從目前的編譯信息來看: warning: #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. 參看 C++ Standard 的 17.4.1.2 (我看了,里面沒有 .h ) Examples include substituting the 用<******>代替<******.h>(把.h去掉), 或者用 To disable this warning use -Wno-deprecated. 編譯器版本的問題,目前的信息看來。 根據(jù)編譯的信息作修改先,不行的話去看 C++ standard 的 17.4.1.2 部分的內容。 再不行的話,帖出編譯信息。 ---------------------------另: 剛才我在虛擬機里裝了個WinGW 2.05, 重現(xiàn)了你的代碼錯誤, C:\MinGWStudio\MinGW\include\c++\3.3.1\backward\backward_warning.h:32:2: warning: #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 去掉 .h 后, 反正上面重現(xiàn)的這段編譯錯誤沒有了。 ----------------------------- 哎,查了查,試了試, 編譯器的問題,或者說標準的問題。 你試下這段代碼把,我這里僅僅是編譯通過了。 revised 是修改的地方。 為什么這么修改,我也是根據(jù)你的編譯信息,google了一下而已。 要符合你的程序需求,可能還要調一下。 編譯器之間的問題還是要重視的。 [ Last edited by gd88 on 2010-11-3 at 04:47 ] |






| 8 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 329求調劑,一志愿西北工業(yè)大學,材料工程(085601) +4 | 小小機靈蟲 2026-03-29 | 10/500 |
|
|---|---|---|---|---|
|
[考研] 材料專碩調劑 +3 | 椰椰。 2026-03-29 | 3/150 |
|
|
[考研] 求調劑,一志愿 南京航空航天大學 ,080500材料科學與工程學碩,總分289分 +7 | @taotao 2026-03-29 | 7/350 |
|
|
[考研] 0856材料化工調劑 總分330 +14 | zhubinhao 2026-03-27 | 14/700 |
|
|
[碩博家園] 求調劑 有機化學考研356分 +3 | Nadiums 2026-03-25 | 4/200 |
|
|
[考研] 343求調劑 +5 | 愛羈絆 2026-03-28 | 5/250 |
|
|
[考研] 本科新能源科學與工程,一志愿華理能動285求調劑 +3 | AZMK 2026-03-27 | 5/250 |
|
|
[考研] 0703化學求調劑 +9 | 奶油草莓. 2026-03-22 | 10/500 |
|
|
[考研] 材料277求調劑 +7 | min3 2026-03-24 | 7/350 |
|
|
[考研] 07化學280分求調劑 +10 | 722865 2026-03-23 | 10/500 |
|
|
[考研] 材料292調劑 +12 | 橘頌思美人 2026-03-23 | 12/600 |
|
|
[考研] 305求調劑 +5 | 哇盧卡庫 2026-03-26 | 5/250 |
|
|
[考研] 求調劑 +3 | 劉柯@ 2026-03-24 | 4/200 |
|
|
[考研] 294分080500材料科學與工程求調劑 +4 | 柳溪邊 2026-03-26 | 4/200 |
|
|
[考研] 中國科學院深圳先進技術研究院-光纖傳感課題組招生-中國科學院大學、深圳理工大學聯(lián)培 +5 | YangTyu1 2026-03-26 | 5/250 |
|
|
[考研] 環(huán)境專碩324分求調劑推薦 +5 | 軒小寧—— 2026-03-26 | 5/250 |
|
|
[考研] 上海電力大學材料防護與新材料重點實驗室招收調劑研究生(材料、化學、電化學,環(huán)境) +4 | 我愛學電池 2026-03-23 | 4/200 |
|
|
[考研]
|
黃粱一夢千年 2026-03-24 | 3/150 |
|
|
[考研]
|
13659058978 2026-03-24 | 4/200 |
|
|
[考研] 接收2026碩士調劑(學碩+專碩) +4 | allen-yin 2026-03-23 | 6/300 |
|