簡體   English   中英

`的#include <iostream> ```-std = c ++ 0x`被打破了

[英]`#include <iostream>` with `-std=c++0x` is broken

如果我指定-std=c++0x到g ++,那么我不能#include <iostream> 我收到以下錯誤消息(mingw下的g ++ 4.4.0):

In file included from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/postypes.h:42,
                 from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/iosfwd:42,
                 from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/ios:39,
                 from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/ostream:40,
                 from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/iostream:40,
                 from f.cpp:1:
c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:159: error: '::swprintf' has not been declared
c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:166: error: '::vswprintf' has not been declared

有什么想法嗎? 這是在最新的g ++中修復的嗎? (如果是這樣,有人知道如何將最新的g ++納入Qt嗎?)

這似乎是一個錯誤 有一個帶有簡單補丁的線程 (最后)。

if win32{
    QMAKE_CXXFLAGS += -std=gnu++0x
}
else {
    QMAKE_CXXFLAGS += -std=c++0x
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM