B. Stroustrup의 프로그래밍 텍스트와 pg 50에 대한 'hello world'프로그램을 사용하면 오류가 발생합니다. "std_lib_facilities.h"포함 파일에 문제가 있습니다.극단적 인 초보자 - 안녕하세요 세계 오류
In file included from /usr/include/c++/4.4/ext/hash_map:60,
from std_lib_facilities.h:34,
from hworld1.cpp:1:
/usr/include/c++/4.4/backward/backward_warning.h:28: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
/tmp/ccpwXUYx.o: In function `main':
hworld1.cpp:(.text+0x14): undefined reference to `std::cout'
hworld1.cpp:(.text+0x19): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccpwXUYx.o: In function `__static_initialization_and_destruction_0(int, int)':
hworld1.cpp:(.text+0x41): undefined reference to `std::ios_base::Init::Init()'
hworld1.cpp:(.text+0x46): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccpwXUYx.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
어떤 제안을하는 방법 파일을 수정하는 방법은, 아마도 해시 부분을 주석 -
출력은 'GCC hworld1.cpp'(루트로) 실행 한 후?
마침내 시작할 시간이 있기를 기대했지만, 이것은 첫 번째 문제 해결 작업보다 약간 더 커 보인다. include로 iostream을 사용하려고했습니다. 우분투 11.04에서 실행하고 있습니다. 아마도 gcc를 업데이트하거나 g ++을 사용해야합니다. 이걸 지나서 내가 쉽게 풀 수 있을지 모르겠다. 나는 '... std'를 ...와 함께 사용하여 몇 가지 시도를했다. 적절한 이름으로 기억하지 못한다. (oops). 누구든지 권리가 있음을 알고 있습니다.
#include "std_lib_facilities.h"
int main()
{
cout<<"hiya people\n";
return 0;
}
C++을 컴파일하고 링크하려면'g ++'를 사용하십시오. – Mat
@ 마크 : Stroustrup은 [한 권 이상의 책] (http://www.stroustrup.com/Programming/)을 가지고 있습니다. – ybungalobill
뿌리로하지 마십시오. – Jookia