Wednesday, February 29, 2012

Building wxWidgets with Microsoft Visual C++ 11

This is practically a non-post as building wxWidgets with the recently released Visual Studio 11 Beta turned out to be completely uneventful. After installing the Visual Studio itself -- which was also perfectly straightforward albeit still a typically Microsoft experience as, obviously, installing a compiler should require you to reboot your machine -- I could build the current wxWidgets with the new compiler from command line using nmake /f makefile.vc without any problems. I did fix a harmless warning about an unrecognized Visual C++ version but no other changes were needed.

So far I don't have any experience with the new compiler yet, i.e. there are no obvious differences compared with VC10. It seems to produce slightly larger binaries (~70MiB instead of ~68 for VC10 for wxmsw29u_core.lib) but this is perhaps a consequence of its beta nature. I do look forward to testing the improved support for C++11 in the new version and, if I have some time, I'd like to play with the new WinRT stuff and, in particular, WRL library to see if it's realistic to write Metro applications in C++ without using Microsoft-specific compiler extensions and, if so, whether we can support Metro in wxWidgets.

7 comments:

count0 said...

It seems with 2.8x branch, there are compilation errors when wxUSE_STL is defined to 1.

Unknown said...

I think it's just assumed that Vadim is talking about building 2.9.x+ since the 2.8.x branch doesn't even support VC10.

Anonymous said...

Have, you tried with Microsoft Visual C++ 11 Express ? It seems to be restricted to metro Application.

Jake Stine said...

Size difference is probably just meta-data differences. A great deal of meta data is embedded into lib files -- especially when LTCG is enabled -- enough that it usually dwarfs the actual compiled binary code portions.

If it's LTCG-related additions then it is entirely likely that the larger LIB file results in better optimized final exes/dlls.

Unknown said...

Thanks for this post.
Do you guys know if it is possible to submit application developped with wxWidgets to windows store?
Thanks,

Jon

Unknown said...

I have tried wxWidgets 2.9.4 with Microsoft VS 11.0 but there are a lot of errors when building project. I downloaded the library from link http://sourceforge.net/projects/wxwindows/files/2.9.4/binaries/ and I saw that it support to VS 10 without VS 11. I'm trying to develop application for WP8. Do you guys know what should I do?
Thanks,
Phong

VZ said...

@Tran This blog is not used for support, please use the forum or the mailing list for this. I also strongly advise you to give a tad more details about the errors you're getting.