| 8 | 1/1 | 返回列表 |
| 查看: 1453 | 回復(fù): 7 | |||
| 本帖產(chǎn)生 1 個 程序強帖 ,點擊這里進(jìn)行查看 | |||
[交流]
【求助】一個程序,不同編譯器結(jié)果不同【已完結(jié)】 已有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. 你這段代碼包含了不贊成的或者是老標(biāo)準(zhǔn)的文件頭, 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 部分的內(nèi)容。 再不行的話,帖出編譯信息。 ---------------------------另: 剛才我在虛擬機里裝了個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)的這段編譯錯誤沒有了。 ----------------------------- 哎,查了查,試了試, 編譯器的問題,或者說標(biāo)準(zhǔn)的問題。 你試下這段代碼把,我這里僅僅是編譯通過了。 revised 是修改的地方。 為什么這么修改,我也是根據(jù)你的編譯信息,google了一下而已。 要符合你的程序需求,可能還要調(diào)一下。 編譯器之間的問題還是要重視的。 [ Last edited by gd88 on 2010-11-3 at 04:47 ] |






| 8 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 298求調(diào)劑 +3 | 種圣賜 2026-03-29 | 3/150 |
|
|---|---|---|---|---|
|
[碩博家園] 求調(diào)劑 有機化學(xué)考研356分 +3 | Nadiums 2026-03-25 | 4/200 |
|
|
[考研] 一志愿北化085600材料專碩275|有文章專利|求調(diào)劑 +7 | Micky11223 2026-03-25 | 7/350 |
|
|
[考研] 求調(diào)劑 +3 | QiMing7 2026-03-25 | 4/200 |
|
|
[考研] 394求調(diào)劑 +3 | 好事多磨靜候佳?/a> 2026-03-26 | 5/250 |
|
|
[考研] 304求調(diào)劑 +6 | 曼殊2266 2026-03-27 | 6/300 |
|
|
[考研] 070300求調(diào)劑306分 +4 | 26要上岸 2026-03-27 | 4/200 |
|
|
[考研] 求調(diào)劑推薦 材料 304 +15 | 荷包蛋hyj 2026-03-26 | 15/750 |
|
|
[考研] 331環(huán)境科學(xué)與工程求調(diào)劑 +3 | 熠然好運氣 2026-03-27 | 3/150 |
|
|
[考研] 求調(diào)劑 +4 | 零八# 2026-03-27 | 4/200 |
|
|
[考研] 279 分 求調(diào)劑 +4 | 睡個好覺_16 2026-03-24 | 4/200 |
|
|
[考研] 085601 材料工程 313分 求調(diào)劑 +5 | Ong3 2026-03-27 | 5/250 |
|
|
[考研] 調(diào)劑推薦 +5 | 清酒714 2026-03-26 | 6/300 |
|
|
[考研] 303求調(diào)劑 +6 | 藍(lán)山月 2026-03-25 | 6/300 |
|
|
[考研] 材料專碩 335 分求調(diào)劑 +4 | 拒絕冷暴力 2026-03-25 | 4/200 |
|
|
[考研] 293求調(diào)劑 +7 | 加一一九 2026-03-24 | 7/350 |
|
|
[考研] 材料專碩找調(diào)劑 +5 | 哈哈哈吼吼吼哈 2026-03-23 | 5/250 |
|
|
[考研]
|
13659058978 2026-03-24 | 4/200 |
|
|
[考研] 335求調(diào)劑 +4 | yuyu宇 2026-03-23 | 5/250 |
|
|
[考研] 一志愿重慶大學(xué)085700資源與環(huán)境,總分308求調(diào)劑 +7 | 墨墨漠 2026-03-23 | 8/400 |
|