Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build wxWidgets 2.9.1 with Visual Studio 2010?

I have a freshly downloaded Visual Studio C++ 2010 Express and wxWidgets 2.9.1. The build folder under wx\build\msw has solution files for VC++ versions 6 through 9 (2008).

I tried to open the latest solution, wx_vc9.sln. It converted all the projects with a bunch of warnings. When I try to build every project gets the error:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6001: Invalid command line switch for "cmd.exe". The path is not of a legal form.

Trying to open the previous version of the solution, wx_vc8.sln, generates the same conversion warnings and the same build errors.

I Googled for some hints and found a suggestion to start with the .dsw file. I opened wx.dsw and it generated an error for each of the project files:

D:\3rdParty\wx\build\msw\wx_wxregex.dsp : error : Project upgrade failed.

Finally in desperation I tried nmake /f makefile.vc and was greeted with yet another error:

NMAKE : fatal error U1077: 'cl' : return code '0xc0000135'

Anybody have any hints? Thanks.

like image 895
Mark Ransom Avatar asked Dec 28 '22 21:12

Mark Ransom


2 Answers

There are two ways of solving this, firstly if you update to a more recent version of the wxWidgets SVN trunk this is fixed (and so it will be fixed in 2.9.2 when it is released). If you don't want to work from trunk of wait for 2.9.2 then if you do a find and replace over all .vcxproj files and replace

>$(INTDIR) $(OUTDIR);%(AdditionalInputs)

with

>%(FullPath);%(AdditionalInputs)

it should then compile fine.

like image 82
SteveL Avatar answered Feb 04 '23 18:02

SteveL


For future reference, trust me people, avoid all nonsense and start up your Visual Studio 2010 Command Prompt and navigate to [wxwidgets directory]\build\msw Then compile using the makefile with the following command :

nmake -f makefile.vc BUILD=release MONOLITHIC=0 SHARED=0 UNICODE=1

Of course change the options as needed. You will be saving a lot of trouble this way, this is the way I did.

like image 23
K.Pratith Avatar answered Feb 04 '23 17:02

K.Pratith