Installing Visual Studio 2017

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Installing Visual Studio 2017

Postby drfrag » Tue Apr 17, 2018 1:38 pm

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 allExpand view
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 allExpand view
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
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: Installing Visual Studio 2017

Postby Rachael » Tue Apr 17, 2018 6:10 pm

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
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Installing Visual Studio 2017

Postby drfrag » Wed Apr 18, 2018 12:53 pm

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
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: Installing Visual Studio 2017

Postby Rachael » Wed Apr 18, 2018 1:09 pm

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
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Installing Visual Studio 2017

Postby drfrag » Wed Apr 18, 2018 1:36 pm

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.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: Installing Visual Studio 2017

Postby SanyaWaffles » Wed Apr 18, 2018 9:16 pm

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
SanyaWaffles
Never trust floor sandwiches
 
Joined: 25 Apr 2013
Location: Eastern Ohio
Discord: SanyaWaffles#5095
Twitch ID: sanyawaffles
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Installing Visual Studio 2017

Postby Graf Zahl » Wed Apr 18, 2018 11:43 pm

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Installing Visual Studio 2017

Postby Rachael » Thu Apr 19, 2018 12:05 am

@ 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
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Installing Visual Studio 2017

Postby drfrag » Thu Apr 19, 2018 5:10 am

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.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: Installing Visual Studio 2017

Postby dpJudas » Thu Apr 19, 2018 5:35 am

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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Installing Visual Studio 2017

Postby Chris » Thu Apr 19, 2018 2:00 pm

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
Chris
 
Joined: 17 Jul 2003

Re: Installing Visual Studio 2017

Postby drfrag » Fri Apr 20, 2018 1:40 pm

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/
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: Installing Visual Studio 2017

Postby dpJudas » Fri Apr 20, 2018 2:46 pm

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.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Installing Visual Studio 2017

Postby leileilol » Fri Apr 20, 2018 6:17 pm

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
leileilol
フォニュエール!!!!!!!!!!
 
Joined: 30 May 2004
Location: GNU/Hell

Re: Installing Visual Studio 2017

Postby Graf Zahl » Sun Apr 22, 2018 1:30 pm

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Next

Return to General

Who is online

Users browsing this forum: No registered users and 3 guests