개발자/Raspberry Pi

라즈베리 파이에서 c++ 컴파일 하기 Raspberry pi c++ compile

지구빵집 2014. 12. 22. 20:52
반응형



한 번 해보면 알 수 있는 것들을 한 번을 하지 않아 모른다.


C++ 예제코드는 Hello Raspberry 를 출력하는 간단한 예제이다.


#include <iostream>

using namespace std;

 

 

int main()

{

          cout << "Hello Raspberry Pi!" << endl;

          return 0;

}


pi@raspberrypi ~/smartfarmtest $ nano helloraspi.cpp - 에디터로 코드 입력

pi@raspberrypi ~/smartfarmtest $

pi@raspberrypi ~/smartfarmtest $

pi@raspberrypi ~/smartfarmtest $ g++ -o helloraspi helloraspi.cpp   - 컴파일

pi@raspberrypi ~/smartfarmtest $ sudo ./helloraspi - 실행

Hello Raspberry Pi!  - 결과

pi@raspberrypi ~/smartfarmtest $


간단한가요 ?







반응형