Nbk
Nbk

Reputation: 13

Will wxwidget 3.1.0 work with Visual Studio 2017

I tried to build the wxWidget library as suggested in the following post

How to set up wxWidgets 3.1.0 with Visual Studio 2015

Just to brief you up, these were the steps mentioned

  1. Grab the sources.
  2. Unpack the sources.
  3. Open VS IDE.
  4. Open \build\msw\wx-vc14.sln (adjust as necessary.)
  5. Go to "Build->Batch Build...", click "Select All", "Build".
  6. Go drink some coffee or watch TV.
  7. After the build finishes, open wxWidgets/samples/minimal/minimal_vc9.sln.
  8. Let MSVC convert the solution to become an appropriate format.
  9. Build and run the sample.

When I clicked on build(Step 5) after selecting all, I got many errors. Is that due to the incompatibility of the wxWidget files with Visual Studio 2017?

This is the error description

As per this description, I am supposed to change the project properties but I am not sure, change Project properties to what? I just need to develop simple Windows app.

I am a newbie to this, I recently completed learning C++ and want to develop some Windows app, so started with wxWidgets.

Upvotes: 1

Views: 4236

Answers (2)

Hzine
Hzine

Reputation: 123

I personally tried the methods mentioned above several times but it failed to build on my VS2017 15.5.2 so I searched and found the best way is that mentioned here, in summary(quote)

  1. Open a "Visual Studio Command Prompt" window shortcut to which must have been installed to the "Start" menu or the "Start" screen by MSVS installation.

  2. Change directory to %WXWIN%\build\msw and type

    > nmake /f makefile.vc
    

    to build wxWidgets in the default debug configuration as a static library. You can also do

    > nmake /f makefile.vc BUILD=release
    

    to build a release version or

    > nmake /f makefile.vc BUILD=release SHARED=1
    

    to build a release DLL version. Finally, you can also add "TARGET_CPU=X64" to nmake command line to build Win64 versions (this only works if you are using a 64 bit compiler, of course).

For x64 build, commands become:

    > nmake /f makefile.vc TARGET_CPU=X64
    > nmake /f makefile.vc BUILD=release TARGET_CPU=X64

See "Configuring the Build" for more information about the additional parameters that can be specified on the command line.

  1. To verify your build, change the directory to samples\minimal and run the same nmake command (with the same parameters there), this should create a working minimal wxWidgets sample.

hope this will help!

Upvotes: 2

catalin
catalin

Reputation: 1987

This is a strange error without an obvious reason, because as far as I've seen "8.1" SDK version is not hard-coded anywhere inside wxWidgets projects.

To workaround it:

  1. [the same] Open \build\msw\wx-vc14.sln (adjust as necessary.)

    4.1. Select all projects in Solution Explorer (click _custom_build, press Shift, click xrc);

    4.2. Right click on the selected project(s) and choose Properties; on top choose Configuration: All Configurations, Platform: All Platforms and on the left Configuration Properties->General;

    4.3. Windows SDK Version will most probably show 8.1, double-click it and it will choose the 10.x SDK version that came with your VS.

    4.4. Hit OK.

  2. Go to "Build->Build Solution".

  3. Drink less coffee, as it should take less minutes on a multicore.

  4. [the same] After the build finishes, open wxWidgets/samples/minimal/minimal_vc9.sln.

  5. [the same] Let MSVC convert the solution to become an appropriate format.

    8.1. repeat steps 4.2 to 4.4 for the current sample;

  6. [the same] Build and run the sample.

For what is worth, installing SDK 8.1 (either from VS or standalone) made no difference. I guess there must be a bug somewhere but it's not all that obvious.

Upvotes: 2

Related Questions