| 5 | 1/1 | 返回列表 |
| 查看: 1454 | 回復(fù): 7 | |||
| 本帖產(chǎn)生 1 個(gè) 程序強(qiáng)帖 ,點(diǎn)擊這里進(jìn)行查看 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
[交流]
【求助】一個(gè)程序,不同編譯器結(jié)果不同【已完結(jié)】 已有2人參與
|
|||
|
這個(gè)程序用VC編譯沒(méi)問(wèn)題,但是用mingw develop studio編譯出現(xiàn)以下錯(cuò)誤: 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 ] |


金蟲(chóng) (小有名氣)
|
從目前的編譯信息來(lái)看: 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 (我看了,里面沒(méi)有 .h ) Examples include substituting the 用<******>代替<******.h>(把.h去掉), 或者用 To disable this warning use -Wno-deprecated. 編譯器版本的問(wèn)題,目前的信息看來(lái)。 根據(jù)編譯的信息作修改先,不行的話去看 C++ standard 的 17.4.1.2 部分的內(nèi)容。 再不行的話,帖出編譯信息。 ---------------------------另: 剛才我在虛擬機(jī)里裝了個(gè)WinGW 2.05, 重現(xiàn)了你的代碼錯(cuò)誤, 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)的這段編譯錯(cuò)誤沒(méi)有了。 ----------------------------- 哎,查了查,試了試, 編譯器的問(wèn)題,或者說(shuō)標(biāo)準(zhǔn)的問(wèn)題。 你試下這段代碼把,我這里僅僅是編譯通過(guò)了。 revised 是修改的地方。 為什么這么修改,我也是根據(jù)你的編譯信息,google了一下而已。 要符合你的程序需求,可能還要調(diào)一下。 編譯器之間的問(wèn)題還是要重視的。 [ Last edited by gd88 on 2010-11-3 at 04:47 ] |

金蟲(chóng) (職業(yè)作家)

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 總分293求調(diào)劑 +6 | 加一一九 2026-03-25 | 9/450 |
|
|---|---|---|---|---|
|
[考研] 297求調(diào)劑 +11 | 田洪有 2026-03-26 | 11/550 |
|
|
[考研] 調(diào)劑考研 +3 | 王杰一 2026-03-29 | 3/150 |
|
|
[考研] 083000學(xué)碩274求調(diào)劑 +8 | Li李魚(yú) 2026-03-26 | 8/400 |
|
|
[考研] 食品工程專碩一志愿中海洋309求調(diào)劑 +4 | 小張zxy張 2026-03-26 | 8/400 |
|
|
[考研] 求調(diào)劑 +3 | QiMing7 2026-03-25 | 4/200 |
|
|
[考研] 藥學(xué)105500求調(diào)劑 +3 | Ssun。。 2026-03-28 | 3/150 |
|
|
[考研] 086502化學(xué)工程342求調(diào)劑 +6 | 阿姨復(fù)古不過(guò) 2026-03-27 | 6/300 |
|
|
[考研] 275求調(diào)劑 +10 | jjjjjjjjjjl 2026-03-27 | 10/500 |
|
|
[考研] 265求調(diào)劑11408 +3 | 劉小鹿lu 2026-03-27 | 3/150 |
|
|
[考研] 085600,材料與化工321分,求調(diào)劑 +9 | 大饞小子 2026-03-27 | 9/450 |
|
|
[考研] 08開(kāi)頭275求調(diào)劑 +4 | 拉誰(shuí)不重要 2026-03-26 | 4/200 |
|
|
[考研] 322求調(diào)劑 +4 | 我真的很想學(xué)習(xí) 2026-03-23 | 4/200 |
|
|
[考研] 081200-11408-276學(xué)碩求調(diào)劑 +4 | 崔wj 2026-03-26 | 4/200 |
|
|
[考研] 321求調(diào)劑 +6 | Ymlll 2026-03-24 | 6/300 |
|
|
[考研]
|
WWW西西弗斯 2026-03-24 | 8/400 |
|
|
[考研] 材料科學(xué)與工程 317求調(diào)劑 +4 | JKSOIID 2026-03-26 | 4/200 |
|
|
[考研] 打過(guò)很多競(jìng)賽,085406控制工程300分,求調(diào)劑 +3 | askeladz 2026-03-26 | 3/150 |
|
|
[考研] 0854人工智能方向招收調(diào)劑 +4 | 章小魚(yú)567 2026-03-24 | 4/200 |
|
|
[考研] 材料/農(nóng)業(yè)專業(yè),07/08開(kāi)頭均可,過(guò)線就行 +3 | 呵唔哦豁 2026-03-23 | 4/200 |
|