wxWidgets 2.8.12 + VS2012

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Earned a small fee
Earned a small fee
Posts: 12
Joined: Sat Mar 02, 2013 9:55 pm

wxWidgets 2.8.12 + VS2012

Post by drautb » Sat Mar 02, 2013 10:00 pm


I'm trying to build the latest stable version of wxWidgets (2.8.12) for Windows using VS2012. I'm using the command line, so I just did what the INSTALL-MSW.txt file said, which was to use nmake like this: 'nmake -f makefile.vc'

It appears to work at first, but after a few minutes it fails with this error:

..\..\src\msw\window.cpp(110) : fatal error C1083: Cannot open include file: 'pbt.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.EXE"' : return code '0x2'

I've been googling this for a while, but haven't been able to find anything. It looks like pbt.h is a file that only exists in Mingw/Cygwin setups, not VS, so is there a flag I should be setting so that the build process doesn't try to include this pbt.h file?


User avatar
Posts: 14617
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxWidgets 2.8.12 + VS2012

Post by doublemax » Sat Mar 02, 2013 10:40 pm

wx 2.8.12 is pretty old and doesn't know about VS2012. I highly recommend to use wx 2.9.4 (or whatever the latest version is).
Use the source, Luke!

In need of some credit
In need of some credit
Posts: 4
Joined: Wed Apr 17, 2013 9:06 am

Re: wxWidgets 2.8.12 + VS2012

Post by wierich_m » Wed Apr 17, 2013 9:21 am


I had the same Problem, but I solved it:
you have to Change the platform toolset from "Visual Studio 2012 (v110)" to "Visual Studio 2012 - Windows XP (v110_xp)"

1. Open wx.sln or if not exists wx.dsw file in Folder build\msw
2. Select all Projects in the Project Explorer
3. Right-Mouse-click and properties
4. Select all configurations
5. Select configuration properties -> General
6. Change the platform toolset as mentioned before

In need of some credit
In need of some credit
Posts: 5
Joined: Mon Apr 22, 2013 1:03 pm

Re: wxWidgets 2.8.12 + VS2012

Post by psunnt81 » Wed Jul 03, 2013 3:11 am

do following if this problem persist as it is ..
Open the window.cpp from ...//wxwidgets2.9.1 or 0/ src/msw..
And than move to line 111 or 112
And make the comment in
//#include <pbt.h>
And save ..
it's working for me in VS2012

In need of some credit
In need of some credit
Posts: 1
Joined: Thu Dec 05, 2013 3:33 am

Re: wxWidgets 2.8.12 + VS2012

Post by soneric » Thu Dec 05, 2013 3:40 am

solved this by adding CXXFLAGS="/DNEED_PBT_H" in invocation of nmake

seems like window.cpp Line 109 should be:
#if !defined __WXWINCE__ && defined NEED_PBT_H
instead of:
#if !defined __WXWINCE__ && !defined NEED_PBT_H

Post Reply