>> Delete Reply from No. 44064 article
No. RE: gcc 대신 g++ 쓰세요 (내용無)

등록 2002-03-07 20:40:00 By localhost     조회 2
이름 흑기사    

		gcc 쓰지 말고 g++ 쓰세요.
 : 요새 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 입니다.
:
: 감사합니다.
:
: --
: 이 곳에 서명을 적어주십시오.
:
: 리눅스를 잘하자--Written by the Black Knight..
파멸의 흑기사
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

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