Erle Robotics C++ GitBook

C++ and Erle-Brain

You should be able to run C++ programs in erleboard:

  • Create a file with the correcte extension .cpp, you can use vim text editor.
  • Use gcc to compile it.The syntax is the following:
    gcc filename.cpp -o executablename
    
    or
    g++ filename.cpp -o executablename
    
  • Now you have an executable file executablename. Do ./executablename to compile it.

Example:

[email protected]:~/C++# ls
hello.cpp
[email protected]:~/C++# gcc hello.cpp -o Hello
[email protected]:~/C++# ls
Hola  hello.cpp
[email protected]:~/C++#
[email protected]:~/C++# ./Hello
Hello World!