Hello World in C++ Using WxDev-C++

If you’re looking for an object-oriented way to write native executables, C++ is still the king. It’s also the queen, the queen mum, and the princes and princesses. Plus, all the farmers, bricklayers, weavers, merchants, bakers, and pub operators. In fact, it’s pretty much every single person in the entire freaking Kingdom of Object-Oriented Native Code.

1. Download wxDev-C++. Wx-Dev-C++ is an open-source compiler for C and C++. As of this writing, it is available at the URL “http://wxdsgn.sourceforge.net/“.

2. Double-click the installer for wxDev-C++ to install it. Follow the prompts, and choose the default settings.

3. Start wxDev-C++ by selecting it from the Start – All Programs menu. The wxDev-C++ window will load, and a startup dialog will appear, prompting for various setup details.

4. In the startup dialog, choose the defaults. When setup is finished, the wx-Dev-C++ IDE will become the active window, and a “Tip of the Day” dialog will appear. Dismiss it.

5. On the wx-Dev-C++ window, choose “File – New – Project” from the main menu. A dialog titled “New Project” will appear, prompting for the type of project to be created.

6. On the New Project dialog, click the icon for “Console Application”, the radio button for “C++ Project”, and enter the value “HelloWorldCPP” in the Name box.

7. Click the OK button to dismiss the New Project dialog. A dialog titled “Save File” will appear, prompting for the disk location at which the new project is to be stored.

8. Using the Save File dialog, navigate to a convenient location, right-click on the directory contents pane, and select the “New – Folder” item from the context menu that appears. Name the newly created directory “HelloWorldCPP”, open it, and then click the Save button to confirm the action and dismiss the dialog. The code pane of the wxDev-C++ window will now contain a tab called “main.cpp”, containing some automatically generated code.

9. Replace the automatically generated code on the “main.cpp” tab with the following text. As of this writing, the only difference between this code and the automatically generated code is a single line at the beginning of the main() function.

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
    cout << "Hello, world!\n";
    return EXIT_SUCCESS;

10. Choose “File – Save” from the main menu, then click the Save button on the Save File dialog that appears. The “main.cpp” source file will be saved in the directory just created for the HelloWorldCPP project.

11. Back on the main window, select “Execute – Compile & Run” from the main menu. A dialog titled “Compile Progress” will appear, and the project’s code wil be compiled. When compilation is finished, a console window will appear containing the text “Hello, world!”

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

2 Responses to Hello World in C++ Using WxDev-C++

  1. Peter says:

    Good material

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s