Install Wxwidgets for create GUI application using C++

Long I don’t write back in this site, and now I will write how to install wxwidgets. Why wxwidgets and not using like gtk/gtkmm/qt?

I choose wxwidgets because wxwidgets supports OOP concepts and cross platform gui application using c++ and wxwidgets in easy to compile on windows not like gtkmm, I always error for compiling newest gtkmm/gtk. And why not qt? I think qt is best cross platform gui too, but you must buy a license if you want using for commercial application.

Okay now first how to install wxwidgets on your Linux (example I using ubuntu 14.04). So to install wxwidgets, just open your terminal and write this code:

$ sudo apt-get install libwxgtk3.0-0 libwxgtk3.0-dev

And this is why I very like linux and open source? Because in Linux and now example ubuntu, to install more applications open source, we not must compile before, we just only install binary/dependencies from repository. Not like Windows, we have to compile the previous.
So if you are using windows, you must download mingw tools, mingw is compilers. Okay for mingw I using TDM-GCC because TDM-GCC is from default support wxwidget, you can see on their website in here
Okay for windows user, first you must need is:

  1. Download c++ compilers from here
  2. Download wxwidgets installer from here And choose Windows installers
  3. If right, the file look like this:

Installation wxwidgets on windows

Then now how to install wxwidgets on windows, you can follow this instruction:

  1. First install your TDM-GCC and install on C: directory like this
  2. And do the same thing on wxWidget installer
  3. And now make sure you have add tdm-gcc bin directory to environment variables (google it if you don’t know and how to add environment variables)
  4. Now open your command prompt and check if your mingw is can be used with this code:
    mingw32-make -version

    And you can get result like this:

    GNU Make 3.82.90
    Built for i686-pc-mingw32
    Copyright (C) 1988-2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

  5. Then for compiling wxwidgets I follow instruction from here So from your command prompt, we must change active directory to wx folder:
    cd C:\wx\build\msw

    And now the first we must clean wxwidget source using this command:

    C:\wx\build\msw>mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release clean

    If clean source finish, then you must compile the source using this command:

    C:\wx\build\msw>mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release
  6. If right and you not get an error, you can have gcc_mswudll folder like this:

Update if you’re using visual studio 2013

If you’re install visual studio, you can’t install TDM-GCC compiler, because we can use windows c++ compiler. So after your visual studio installed, open windows explorer and go to C:\wx\build\msw and open file wx_vc12.sln and wait visual studio load this file until finish.

After that make sure the solution configurations is Debug mode if you want create static library or if you want create shared library you can use DLL debug/DLL Release:

What is the different of static and shared libraries?

And this is simple answer from me:

With static library, you can build/compile your applications to one file executable. But if you use with shared library, your applications need/must include .dll file

Look at this picture, I create application with static library and shared library.
This file is using shared library:

This file is using static library:

And for more info about static and shared library, read from this site or you can google it.
Okay then after you choose wat you want (static or shared), now right click the project from solutions explorer and select Build Solution or you can use key shortcut CTRL + SHIFT + B.

Wait until finish and not showing the error. If the compile is successfully you can see directory vc_lib in C:\wx\lib for if you’re compile using debug mode (static library) and vc_dll if you’re compile using DLL debug/DLL release mode.

And now we must create sample applications. Example for development editor I use codeblock. And for the next tutorial to create sample applications follow from this page



  1. You share interesting things here. I think that your website can go viral easily, but you must give it initial boost and i know how to do it,
    just search in google – omgerido traffic method

  2. It’s a shame you don’t have a donate button! I’d most certainly
    donate to this fantastic blog! I guess for now i’ll settle for book-marking and adding
    your RSS feed to my Google account. I look forward to fresh updates and
    will share this website with my Facebook group. Talk soon!

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s