Warning: session_destroy() [function.session-destroy]: Session object destruction failed in /home/httpd/html/board/include/header.php on line 32
적수네 동네 - 질문과 답변 [ 게시물 삭제 ]
>> Delete No. 44064 article
No. [질문] STL 을 사용한 C++ 코드컴파일은 어떻게
해야하나요?

등록 2002-03-07 16:31:00 By localhost     조회 2
이름 이승현    

		요새 linux 에서 c++ 공부를 하고 있는데 다음의 STL 예제는 어떻게 컴팔
해야 하는지 알수가 없네요..
 stl_list.C
 #include <iostream>
#include <list>
 int main(int argv, char *argc<>){
   list<int> lst;
   return 0;
}
 이렇게 소스를 만들고 다음과 같이 컴파일을 했습니다.
 [userttma@localhost exam03]$ gcc -o lst stl_list.C
/tmp/ccB1YRdQ.o: In function
`__malloc_alloc_template<0>::_S_oom_malloc(unsigned int)':
/tmp/ccB1YRdQ.o
(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned
int)+0x1a): undef
ined reference to `endl(ostream &)'
/tmp/ccB1YRdQ.o
(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned
int)+0x27): undef
ined reference to `cerr'
/tmp/ccB1YRdQ.o
(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned
int)+0x2c): undef
ined reference to `ostream::operator<<(char const *)'
/tmp/ccB1YRdQ.o
(.__malloc_alloc_template<0>::gnu.linkonce.t._S_oom_malloc(unsigned
int)+0x37): undef
ined reference to `ostream::operator<<(ostream &(*)(ostream &))'
collect2: ld returned 1 exit status
 그랬더니 위와 같은 에러 메시지가 쏟아져 나오네요..
 이럴때는 어떻게 해야 하나요?
 default allocator 를 지정해줘도 문제가되고 안해줘도 문제가되고..
 STL은 쓰기에 까다로운듯 합니다.
 적용환경은  hancomlinus gcc 2.96 입니다.
 감사합니다.--이 곳에 서명을 적어주십시오.
 리눅스를 잘하자
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved