Installing Visual Studio 2017

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Installing Visual Studio 2017

Post by drfrag »

Now with VS 2017 you can create an offline installer without registering. The minimum installation for C++ development and compiling ZDoom weights 1.44 GB vs over 7 GB of the 2015 edition. It's easy to get a non functional installation since MS has classified some packages as optional when they should be required so i'm posting how i created it. This is for the community edition of course.

Download vs_community.exe, then save the following text as vs2017.cmd, pack the contents of the vs2017layout folder into a zip (store), extract it on the destination machine and run setup. Note that i had the .NET framework already installed on that machine (Edit: it's included in the installation).

Code: Select all

vs_community.exe --layout c:\vs2017layout --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop --lang en-US
https://docs.microsoft.com/en-us/visual ... ty-network

Code: Select all

vs_community.exe --layout c:\vs2017l --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop --add Microsoft.Component.VC.Runtime.UCRTSDK --add Microsoft.VisualStudio.Component.VC.140 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP --lang en-US
Edit: fixed the layout adding the Win 10 SDK (1.44 GB).
Edit: added alternative package with v140 toolset (VS 2015) and XP support (2.95 GB).

On the IDE itself i installed VS 2013 first to learn C# but it cannot even compile C99 and only supports up to C++98. Hope it's not that bad for C#.
Then i must say i like much more CodeBlocks + MinGW. It's much lighter, about one tenth in size. The MS compiler is faster but gcc is much better (and it's standard C++). Instead of meaningful error messages you get silly codes and a short message, when you get an error in an included file it won't tell you where it's included from. Also the compiler can crash, for instance i got one compiling the old truecolor branch in zcc_expr.cpp with lambdas and had to revert one commit. Changing the floating point model or architecture didn't help.
IMHO since GZdoom already compiles with gcc it would be a good idea to fix compilation with MinGW (MinGW-w64?) after the 2D refactor is complete, hope i can help with that.
Last edited by drfrag on Thu May 31, 2018 5:24 am, edited 7 times in total.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Installing Visual Studio 2017

Post by Rachael »

GZDoom should compile with MinGW and was kind of meant to, but it was never a major requirement or a focus. I am not surprised if GZDoom breaks compile now on MinGW.

The biggest issue with VS2017 is that it is a proprietary tool - something the open source community does not like and would eagerly find a replacement for if they could (not that there isn't already a few to choose from).

With those considerations in mind, however, VS2017 still remains the primary toolchain being used in Windows by, as far as I know, all the current active developers - and has replaced VS2015.

So yes, it would be a good idea to fix MinGW compile, but it'll probably just break again right after the very next refactor that takes place.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Installing Visual Studio 2017

Post by drfrag »

Yeah i forgot to mention MinGW is free software.
To avoid the compiler crashes specially with old versions adding the VC++ 2015.3 v140 toolset for desktop (x86,x64) could help but i'm not sure (with '--add Microsoft.VisualStudio.Component.VC.140'). This increases the size of the installer to 2 GB.
I know why VS is faster, compilation from a CMake generated makefile only uses one core. I don't know how to pass parameters to mingw32-make from CMake if that's even possible.
Then what i commented in the other thread, with MinGW portals are broken in the old GL renderer in ZDoom32 (may be some undefined behavior in the old code?). With VS 2017 the release build crashes upon loading a map in gl_setup.cpp, debug works. I don't know about VS 2015 i guess it should work (obviously?).
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Installing Visual Studio 2017

Post by Rachael »

Do "make -j4" (replace 4 with # of processors, including virtual ones) at the command prompt to speed up MinGW. It's the same on all platforms.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Installing Visual Studio 2017

Post by drfrag »

Thanks, i use mingw32-make but i think it's the same (from the command line). However i compile from within CodeBlocks and no way there, there's a make commands option for custom makefiles but it's ignored.
SanyaWaffles
Posts: 800
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields
Contact:

Re: Installing Visual Studio 2017

Post by SanyaWaffles »

Despite the instructions I seem to have problems with finding winsock2.h and some associated libraries. Installing and manually setting the SDK to a Windows 10 SDK fixes it.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Installing Visual Studio 2017

Post by Graf Zahl »

Rachael wrote:GZDoom should compile with MinGW and was kind of meant to, but it was never a major requirement or a focus. I am not surprised if GZDoom breaks compile now on MinGW.

The biggest issue with VS2017 is that it is a proprietary tool - something the open source community does not like and would eagerly find a replacement for if they could (not that there isn't already a few to choose from).

With those considerations in mind, however, VS2017 still remains the primary toolchain being used in Windows by, as far as I know, all the current active developers - and has replaced VS2015.
There's reasons why almost nobody uses MinGW32, not the least of which is the far superior debugging tools in VS. I couldn't work without them. Free compilers are all nice and well but it is always best to build software with the tools supplied and/or supported by the OS's manufacturer.

One thing about MinGW that really irks me is that they link against an ancient (i.e. Visual C++ 6.0) CRT that just happens to be supplied as a part of Windows itself.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Installing Visual Studio 2017

Post by Rachael »

@ drfrag: Yeah, I am sorry I have no idea how to work CodeBlocks I do not use it myself, I use VS2017 along with the rest of the developers. Still, your invitation to fix up the code to compile with MinGW is a welcome one, provided it does not require or introduce a number of hacks just to get it to compile (simple fixes like what _mental_ does to fix Clang compiles is more along the lines of what I am talking about).

@ Sanya: Did you follow the instructions in the wiki? It instructs you to download extra SDK's. If those direct instructions do not work, then it may have been a compiler bug that I unwittingly introduced with the stat code (although, since Graf disabled it, does that file even still link?).

@ Graf: Much as I'd like to use free software as much as possible, I will agree with you in this instance, but mostly because I honestly don't know how to use CodeBlocks/MinGW/GCC's debugging tools and have never had an interest or need to learn. (I suppose that will eventually change down the line, but for now I'm happy with what I've got)

I will say this though - what little experience I have with the GNU toolchain debuggers has been an absolute nightmare - enough to drive me away straight to Visual Studio to try and replicate crashes when something goes wrong.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Installing Visual Studio 2017

Post by drfrag »

Sorry, i've fixed the VS layout. Monkeysoft documentation is poor and incomplete so this is tricky and installing VS is a pain. The remove parameter mentioned in the docs doesn't even exist. I've added the Win 10 SDK and removed the Win 8.1 SDK and XP support. Graphics tools were not needed. So now it's 1.44 GB or just a floppy disk (or was that 1.44 MB?).

I will compile from the command line when i need speed from now on (i've just switched to a dual core), CodeBlocks is useful mainly for debugging. Sure the VS debugger must be much better but the GNU one it's okay for me. So yeah that must be the only reason to use VS, i don't find the IDE that great and the compiler IMHO is of poor quality. CodeBlocks is also available on linux and macos also.
I said i could try to help. I'm on a 32 bit OS with only 2 GB of ram, MinGW-w64 gcc 6.4 release. Also i only use hacks to fix crashes. :)
Last edited by drfrag on Thu Apr 19, 2018 2:45 pm, edited 1 time in total.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Installing Visual Studio 2017

Post by dpJudas »

One of the few reasons I'm staying on Windows is that to me, personally, there's no IDE that comes even remotely close to Visual Studio on neither Linux or macOS. I can do work on the other platforms, but I'm usually an order of magnitude slower at doing things - especially if it requires editing cross multiple files or even the simplest debugging.

As for mingw, I always got the impression that implementation was a big hack. When you can't include windows.h, or when it links to the Windows' system/DDK CRT (the one that used to be Visual C++ 6.0) then this is just waiting to become a maintenance and deployment problem down the road. On the other hand, clang seems more willing to make a proper Windows port of their compiler - it tries to follow the platform calling conventions and other basic requirements that I think must be met by a compiler seriously targeting Windows.
User avatar
Chris
Posts: 2940
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Installing Visual Studio 2017

Post by Chris »

Graf Zahl wrote:One thing about MinGW that really irks me is that they link against an ancient (i.e. Visual C++ 6.0) CRT that just happens to be supplied as a part of Windows itself.
The upside being, it doesn't require some specific version of an external runtime to be installed for its executables. And it provides its own C runtime functions, implementing many things VC doesn't (it's much better at C99/C11 support, for example).
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Installing Visual Studio 2017

Post by drfrag »

I've investigated the issue with the missing winsock2.h and apparently it's a broken package. Not surprisingly no one has bothered at Monkeysoft.
I can compile GZDoom with the Windows 8.1 SDK since i already had VS 2013 installed, that way i could keep XP compatibility for the old versions. However the compiler is even more broken than the 2015 version and crashes with old versions or the optimized executable crashes instead.

I still think MinGW is a better toolchain since the MS compiler is awful, internal compiler errors are even more frequent in the 2017 version. It's not 100% standard and can compile even syntactically wrong code, and can crash with correct code. Also the VC executables can tolerate memory leaks while they crash with gcc, then there's the problem with uninitalized variables. Seems you don't need to include windows headers? and when you include them with MinGW you get conflicts. I think a good compiler like gcc is needed to find problems which can go unnoticed with VC, may be i'm wrong. After all i cannot be considered a real developer, you know I.R. developer, I.R. smart. :)

BTW MSVC still reports __cplusplus as 199711L, you need to use a command line switch to report a more recent value otherwise a lot of code wouldn't compile.
Finally the last update to VS 2017 actually supports MinGW, i guess with limitations of course.
https://blogs.msdn.microsoft.com/vcblog ... en-folder/
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Installing Visual Studio 2017

Post by dpJudas »

drfrag wrote:It's not 100% standard and can compile even syntactically wrong code, and can crash with correct code.
That is true for all the compilers. None of them are 100% standards compliant with no bugs. But really, if you're getting internal compiler errors all the time from MSVC you must be doing something wrong. I've seen two the last year - one solved by a rebuild. I work professionally every day with that compiler - if it constantly crashed I would notice it.

That's not to say MSVC is the best compiler (clang wins that competition currently imo) - but it IS the best compiler on Windows. As you said yourself, mingw cannot even include the system headers(!). IMO all mingw is good for is acting as an emulator for poorly coded applications that couldn't do platform abstraction correctly and can't compile outside a posix environment.
drfrag wrote:I think a good compiler like gcc is needed to find problems which can go unnoticed with VC, may be i'm wrong.
If you ask me, gcc is only good for building on Linux where that's the compiler around. If you're targeting Windows I see no advantage in using it whatsoever.
User avatar
leileilol
Posts: 4449
Joined: Sun May 30, 2004 10:16 am
Preferred Pronouns: She/Her
Location: GNU/Hell

Re: Installing Visual Studio 2017

Post by leileilol »

dpJudas wrote:If you ask me, gcc is only good for building on Linux where that's the compiler around. If you're targeting Windows I see no advantage in using it whatsoever.
Not adhering to Microsoft's insistent platform regressions and VC20XX library requirements is an advantage - at least until gcc 4.9 anyway before they went on a MS-like deprecating spree.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Installing Visual Studio 2017

Post by Graf Zahl »

GCC may be a good compiler. Clang definitely is. The main problem on Windows isn't the compilers - it's the toolchains that flat out suck.

And regarding the compiler features deprecation, that was all about becoming more spec-compliant. Having multiple different compilers, all with their own language extensions is a nightmare for writing platform independent code.

And as things stand, GCC is by far the worst in this regard, mainly because it advertises itself as a standard compliant compiler and thus making many programmers use its non-standard features. At least the VC++ team has realized that this isn't the way to go forward.

Of course all that doesn't even come close to touching the most annoying subject of C++ programming, and that is the bootload of undefined behavior and a committee that seems to be so stuck in the past - forgetting that any bit of undefined or implementation defined behavior is a source for major trouble. I wonder when these people finally wake up, but I do not hold any hopes here.
Post Reply

Return to “General”