Helloworld. My first C++ Program.

1) Open the BeIDE application. You can do this by clicking on the Be icon on the Deskbar and going to the apps menu item, you'll find an entry for the BeIDE there.

2) From the menu, select File -> New Project

3) From the New Project window, select BeSTL. The BeSTL is the stationary for using the C++ Standard Template Library, and is best for a command line application such as this. You can find links to information about the STL at NPC.

4) The Save As Dialog appears. Save the file as "helloworld.proj". A new Project window (helloworld.proj) appears. A standard feature in most modern GUI's is you can click on "Untitled.proj" and highlight just the "Untitled" portion and rename that by just typing over it.

5) Click on the BeIDE main window (should still read "Untitled 1", and it is not the "helloworld.proj" window). Type in the following code verbatim:

#include <iostream>

int main()
{
   cout << "Helloworld.  My first C++ program." << endl;
   return 0;
}

Note that most C++ books still use the ANSI/ISO C++ Draft Standard, and therefore will show that you include <iostream.h>. This is no longer required on the final ANSI/ISO Standard C++ compilers, the requirement for the .h (indicating a header file) has been removed. The BeOS R4.5 BeIDE is compliant with the final version of the standards on both Intel and PPC systems.

If your release of BeOS is older, and does not recognize this new standard, try to add the .h (#include <iostream.h>)and see if that works instead.

6) Select menu item File, click Save As. Name the file "helloworld.cpp". Check the "Add to Project" box. Click the Save button. The window should now be titled "helloworld.cpp".

7) Select the Window menu item and click on Settings... On the left side of the Dialog, find the "x86 ELF Project" item (and obviously, PPC Project on the PPC) and click on it. Under filename, change "BeSTL" to read "helloworld" and click the Save button, and then exit the Settings dialog by clicking the Cancel button.

8) Click on the "helloworld.proj" Project window. Select the Project menu item and click Make.

9) Open the Terminal application located on the Deskbar menu under the Apps folder. Type "pwd". Ensure you are in the /boot/home directory. Type "cd helloworld" and enter. You can do "ls" to see all of the files in your projects directory (one of these had better be called helloworld and others should be called helloworld.cpp and helloworld.proj).

10) Type in "helloworld" and press enter. You should see the Terminal display the following:

    Helloworld.  My first C++ program.

11) Congratulations. You have just programmed your first program in C++ on the BeOS! After the initial excitement wears off, you can type "exit" to exit out of the Terminal, and close all BeIDE windows (or choose Quit from the File menu).

Now you can move on to explain what it is that we have done here. Go here to begin.