From the previous post, I create a tutorial with CodeBlock as an Editor, and now I will create a tutorial with Visual Studio 2013 editor and using microsoft compiler. The first I assume you have to install it into your windows system.
Now open your Visual Studio editor and click File → New → Project (Ctrl + Shift + N).

Then select Visual C++ and choose Empty Project. Don’t forget to change Project name with “test” and save to your favorite directory.

Okay now you can write code, to do that right click your project and select Add → New Item.

And then after window dialog show up, select add Header File (.h) and change the name to test.h.

Then insert this code:

#ifndef TEST_H
#define TEST_H
#include <wx/wx.h>
class Test : public wxFrame
    Test(const wxString& title);
    // Destructor
#endif // TEST_H

After insert code test.h, we must create test.cpp, to create this file, same as before instruction right click your project and select Add → New Item. After window dialog show up, select add C++ File (.cpp) and change the name to test.cpp.

Then insert this code:

#include "test.h"
Test::Test(const wxString& title)
    : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(250, 150))
Test::~Test() {}

Do same for create main.h and main.cpp. And this is the code:

#ifndef MAIN_H
#define MAIN_H
#include <wx/wx.h>
class MainApp : public wxApp
    virtual bool OnInit();
#endif // MAIN_H
#include "main.h"
#include "test.h"
bool MainApp::OnInit()
    Test *test = new Test(wxT("Test"));
    return true;

Then before compile the code, you must setting the project such as include required some library. So right click your project → and click properties (Alt + Enter). Then after windows dialog show, select Configuration properties → C/C++ → General. And in Additional Include Directory insert this code:


C:\wxwidgets You have to adjust it to the your wxwidgets installation folder.
Then same in menu C/C++ → General, in Preprocessor definitions you must add this code:


Now open Linker menu → General, in Additional library directories you must add this code:


Then open menu input in Linker menu and add this code to Additional dependencies:


The last we must build the test project with select menu Build → Build test.

After that select menu Debug → Start without debugging (Ctrl + F5) and you can see this applications:

Make sure before your build the project, the project on mode debugging:


  1. I’ve been surfing online more than three hours as
    of late, yet I by no means found any attention-grabbing article like yours.
    It is pretty value sufficient for me. In my view, if all webmasters and bloggers made just right content
    material as you did, the internet shall be a lot more useful than ever before.

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