building wxWidgets in Visual Studio 2017 Community Edition Topic is solved

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
drmatt
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Jun 30, 2017 11:08 pm

building wxWidgets in Visual Studio 2017 Community Edition

Post by drmatt »

Hello,

I just upgraded from VS 2015 to 2017 Community Edition and can no longer build wxWidgets from source. I've cloned the git repo and see that there is a wx_vc15.sln, presumably for the latest versions of VS, but when I tried doing a build from that solution I first got errors saying that the Windows 8.1 SDK was not installed. After installing that, I now get lots of errors that standard header files are missing, like this:

5>c:\users\me\data\libs\wxwidgets\src\regex\regcustom.h(32): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory (compiling source file ..\..\src\regex\regerror.c)

...

3>..\..\src\expat\lib\xmlparse.c(5): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory

I'm not sure how this is possible since these headers should be part of the standard library. I thought maybe my VS installation was borked so I repaired it, but still see the same problem (though it could still be something misconfigured on my system).

Has anyone else run into this issue, or has a pointer to what might be causing it? Any help would be greatly appreciated. Thanks in advance!
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: building wxWidgets in Visual Studio 2017 Community Edition

Post by doublemax »

Check the VS include paths and that the correct toolset is chosen in the project properties.
Use the source, Luke!
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: building wxWidgets in Visual Studio 2017 Community Edition

Post by catalin »

I've seen something similar with VS 2017 and missing Windows SDK version 8.1. I tried installing sdk 8.1 separately and by using VS installer. They both installed succesfully but could not be seen/used by VS. This was very unexpected when installing from VS installer...
Finally I modified all wxW projects to use the SDK of VS 2017 (10.0.14393.0) - [project] Properties -> General -> double click Windows SDK Version. This is uncomfortable because these changes should be ignored when making others, and they needed to be made for All Configurations & All Platforms so they required a lot of clicks...
drmatt
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Jun 30, 2017 11:08 pm

Re: building wxWidgets in Visual Studio 2017 Community Edition

Post by drmatt »

Thanks for your responses!
doublemax wrote:Check the VS include paths and that the correct toolset is chosen in the project properties.
I expected that the bundled wx .sln file should work "out of the box" and that I shouldn't need to change any paths or other settings. All worked very well in VS 2015 building the latest stable wx release.
catalin wrote:I've seen something similar with VS 2017 and missing Windows SDK version 8.1. I tried installing sdk 8.1 separately and by using VS installer. They both installed succesfully but could not be seen/used by VS. This was very unexpected when installing from VS installer...
Finally I modified all wxW projects to use the SDK of VS 2017 (10.0.14393.0) - [project] Properties -> General -> double click Windows SDK Version. This is uncomfortable because these changes should be ignored when making others, and they needed to be made for All Configurations & All Platforms so they required a lot of clicks...
Now that I've installed the 8.1 sdk, I think this is no longer an issue (it does not complain about 8.1 sdk not being found). It is strange that these basic standard include files cannot be found during the build though. I did try right-clicking the solution and doing 'retarget' for sdk 10.x but still run into the same issue, unfortunately. Have you successfully built from source with VS 2017 using the included solution and project files?
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: building wxWidgets in Visual Studio 2017 Community Edition

Post by doublemax »

I expected that the bundled wx .sln file should work "out of the box" and that I shouldn't need to change any paths or other settings. All worked very well in VS 2015 building the latest stable wx release.
Yes, it should. I'm almost certain that the upgrade from VS2015 to 2017 messed something up. VS is notorious for things like that.
Use the source, Luke!
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: building wxWidgets in Visual Studio 2017 Community Edition

Post by catalin »

drmatt wrote:Now that I've installed the 8.1 sdk, I think this is no longer an issue (it does not complain about 8.1 sdk not being found).
How did you install it? For me it still complained after installing it in 2 different ways.
drmatt wrote:It is strange that these basic standard include files cannot be found during the build though.
Something is indeed strange. However IIRC these build files do not use an explicitly set SDK or paths, but some presets (from env vars? Registry?). I think there is an erroneous (OS?) setting somewhere that fools VS 2017.
drmatt wrote:I did try right-clicking the solution and doing 'retarget' for sdk 10.x but still run into the same issue, unfortunately.
Uhm, I thought I did say you should do it for each project. If I didn't then here it goes now
drmatt wrote:Have you successfully built from source with VS 2017 using the included solution and project files?
I have, but only after changing the SDK to 10.x for each project (all configurations & all platforms).
drmatt
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Jun 30, 2017 11:08 pm

Re: building wxWidgets in Visual Studio 2017 Community Edition

Post by drmatt »

catalin wrote: How did you install it? For me it still complained after installing it in 2 different ways.
I installed via the installer from https://developer.microsoft.com/en-us/w ... ws-8-1-sdk.
catalin wrote: Something is indeed strange. However IIRC these build files do not use an explicitly set SDK or paths, but some presets (from env vars? Registry?). I think there is an erroneous (OS?) setting somewhere that fools VS 2017.
doublemax wrote:I'm almost certain that the upgrade from VS2015 to 2017 messed something up. VS is notorious for things like that.
That is certainly possible. I may try to reinstall VS 2017 again. However, I've built a number of other libraries already with this installation and did not run into any errors like this, which is why I'm a bit stumped.
catalin wrote: Uhm, I thought I did say you should do it for each project. If I didn't then here it goes now
Yes you did! And I did follow your suggestion, however it did not change the include-file-not-found errors or compile failures for any of the projects.

I'm going to dig into this a little more now but is there anything else I might be missing?
drmatt
In need of some credit
In need of some credit
Posts: 4
Joined: Fri Jun 30, 2017 11:08 pm

Re: building wxWidgets in Visual Studio 2017 Community Edition

Post by drmatt »

Update: It turns out I had missed two of the projects' properties, and when I retargeted those two, the errors disappeared and the solution built. Your solution was absolutely correct, thank you!
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: building wxWidgets in Visual Studio 2017 Community Edition

Post by doublemax »

BTW: You can select all projects in a solution and then make the changes, you don't have to do it for every single one individually.
Use the source, Luke!
Post Reply