C++ 컴파일 에러.

imdsoho의 이미지

c++을 사용하여, thread를 공부하고 있습니다.

c++로 작성한 프로그램을 컴파일하니.

In file include from /usr/include/c++/3.2.2./backword/
iostream.h:3,
from cppthread.cpp:1:

/usr/include/c++/3.2.2/backward/backward-warning.h:32:2 warning:

#warning this file include at least one deprecated or antiguqated header.....

이러고도 한참을 메세지가 나옵니다.

include 파일 설정을 따로 해주어야지 하나요?

# cc -o th cppthread.cpp -lpthread

라고 컴파일 명령했습니다.

june의 이미지

g++ 쓰세요.
g++ -o th cppthread.cpp -lpthread

커피는 블랙이나 설탕만..

doldori의 이미지

iostream.h는 표준 헤더가 아닙니다. <iostream>과 std namespace를 쓰세요.

응물이의 이미지

#include <iostream>
using namespace std;
int main(){
//이케 하시면 될꺼에요 +_+;
return 0;
}