내 프로그램이 C++로 작성되었으며 g ++ 4.3.4를 사용하는 우분투 9.04 및 g ++ 3.4.3을 사용하는 Solaris OS에서 성공적으로 컴파일 할 수 있습니다. 이제 우분투를 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’
버그 수정 방법 및 버그가있을 수 있습니다. 도와 줄수있으세요?
모든 조언에 대해 감사드립니다. 당신이 어떤 표준 라이브러리 헤더를 포함하면
포함 파일이 없습니다. 여기에서 보면 std lib에 실제로 버그가있는 것처럼 보입니다. 그러나 어쩌면 여러분은 잘못된 것을했을 수도 있습니다. 오류를 재현하여 질문에 넣을 수있는 몇 줄로 바꿀 수 있습니까? – sbi
그냥 테스트 :'#include int main() {std :: deque d1, d2; d1.swap (d2); }'우분투 9.10, g ++ 4.4.1에서 컴파일됩니다. 컴파일 유닛에 포함 된 것을 보여줄 수 있습니까? –