我有我的程序用C++編寫,它可以成功編譯在Ubuntu 9.04與g ++ 4.3.4和Solaris OS與g ++ 3.4.3。現在我已經將我的Ubuntu升級到版本9.10和g ++到版本4.4.1。現在編譯器調用STL中的錯誤。G ++ 4.4編譯錯誤,低版本工作
/usr/include/c++/4.4/bits/stl_deque.h: In member function ‘void std::deque<_Tp, _Alloc>::swap(std::deque<_Tp, _Alloc>&)’:
In file included from /usr/include/c++/4.4/deque:65,
/usr/include/c++/4.4/bits/stl_deque.h:1404: error: ‘swap’ is not a member of ‘std’
/usr/include/c++/4.4/bits/stl_deque.h:1405: error: ‘swap’ is not a member of ‘std’
/usr/include/c++/4.4/bits/stl_deque.h:1406: error: ‘swap’ is not a member of ‘std’
/usr/include/c++/4.4/bits/stl_deque.h:1407: error: ‘swap’ is not a member of ‘std’
我不知道如何解決它,如果可能的話,STL包含一個錯誤。你能幫我嗎?
非常感謝所有的建議。
包含文件丟失。從這裏看起來它確實是std lib中的一個bug,但是也許你做錯了。你能把它提煉成幾行來重現錯誤並把它們寫入你的問題嗎? – sbi 2010-02-25 12:39:22
剛剛測試過:'#include int main(){std :: deque d1,d2; d1.swap(D2); }在ubuntu 9.10中,g ++ 4.4.1編譯。你可以在編輯單元中顯示包含的內容嗎? –
2010-02-25 13:40:36