6 ms·
Advice to young devs: If you don't have a good professional reason why you absolutely need to use gnu tools on windows, and you have no technical reason not to
by fsloth 6y ago
Advice to young devs: If you don't have a good professional reason why you absolutely need to use gnu tools on windows, and you have no technical reason not to use Visual Studio, use Visual Studio. It's good enough, and for me, even good.
- markus_zhang 6y agoVS is perfect for C++. For C I think I might need a different compiler?
- AlexeyBrin 6y agoYou can use VS for C just fine on Windows, VS 2019 has full support for C89 and almost complete C99 support. Next iteration of VS 2019 will even add support for _Generic. But, if you want to write portable code to other operating systems, I suggest to build your code with both VS and GCC.
- pjmlp 6y agoTo the extent required by ISO C++, for the rest there is first class support for clang. The latest version of the VS2019 installer already packages clang 10.
- deleted 6y ago[deleted]
- vsgeneric 6y agoDo you have a source for the news on _Generic? I can't find any. If it is true, it would be amazing. So many of my APIs are unwieldy because of Microsoft's refusal to support this one feature.
- AlexeyBrin 6y agoHere you go https://developercommunity.visualstudio.com/idea/443508/msvc-2017-does-not-support-generic-type-generic-ma.html https://developercommunity.visualstudio.com/idea/443508/msvc... Read the comments, it should be available in the next VS2019 update.
- pjmlp 6y agoVisual Studio has first class support for clang, that is Microsoft's answer for those that still want to use C on Windows.
- markus_zhang 6y agothanks I'm using gcc inside of a Ubuntu Vbox but yeah llvm with VS would also be good~
- qalmakka 6y agoInstall llvm. Clang can use all of MSVC headers without breaking compatibility with its ABI, like MinGW does (you can't mix up DLLs built with the MSVC ABI and the MinGW one)
- markus_zhang 6y agoThanks I'm sticking to my Linux vbox at the moment but will try it out whence I move back to Windows.
- qalmakka 6y agoThe only real downside of using MSVC is the mind boggling amount of storage it hogs with libraries you'll never ever use not even once if your goal is to just build simple C++ programs. MinGW might be the only viable approach if you are storage constrained (LLVM/Clang also supports MinGW of course)
- gpderetta 6y agoIf you are targeting only Windows it is fine, but for portable programs you might not want to maintain parallel buid systems. CMake works though.
- naavis 6y agoVisual Studio supports CMake nowadays.
- mbeex 6y ago> Visual Studio supports CMake nowadays. It tries to embrace it, but this is not necessary (and limited for non-trivial cases - and what isn't non-trivial for serious projects). CMake itself has good VS support for a long time. I always try to create VS solutions in parallel with ninja, nmake, jom, whatever completely from it without hand-holding of some integration.
- fsloth 6y agoI've done my fair share of professionally maintaining portable programs and my preferred choice nowadays is to extract platform independent and platform dependent code to their own libraries and then just implement what is the most out-of-the box simple way to define a build per each platform.
- pjmlp 6y agoThat has always been the case actually, since Windows 3.x, except that back then probably Borland would be a better option. Using such tools for me was only to do university work at home.
- jmiskovic 6y agoYour advice would have more weight if you provided some arguments. GNU tools are also good enough, and this kit seems like a lot easier way to get started with your C lab exercise than installing Visual Studio and getting lost in it. I dislike Visual Studio because to set things up you have to compare online screenshots to your settings and click around multiple tabs of configurations. In the end you (as beginner) don't know what libraries get included and if it will work on another computer. GNU tools are text-driven, so easier to replicate and to reason about.
- pjmlp 6y agoDepends where one is coming from, when I was TA at my university Visual Studio was the official C++ lab exercise tooling for first year students, in Win 9x with student drivers mounted on login. We did not do bare bones C already in those days.
- Koshkin 6y agoCommand-line "build tools" are freely available for those who do not care about the IDE: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019 https://visualstudio.microsoft.com/downloads/#build-tools-fo...
- marcoperaza 6y agoThe GNU tools are not fully compatible with the Windows ABI and they don't support some important Windows features. There are great reasons to use the GNU tools, like compiling unix programs that do not otherwise target Windows. But you are swimming upstream if you use the GNU tools for general Windows development. Windows is a complex, integrated system that has evolved over a long period of time and is very different from unix-like operating systems. The peculiarities that exist in MSVC and associated tools are not just the whimsies of Microsoft devdiv engineers and product managers, but often tie in to operating system functionality. If you try to develop Windows applications with mingw, you will eventually hit weird problems and errors that simply would not exist if you used Microsoft's toolchain. If you want an alternative to Microsoft's compiler, then consider llvm, which is aiming for full ABI compatibility and even produces PDBs (though I'm skeptical that they're as complete as the ones generated by Microsoft's tools). But the compatibility is incomplete, so ymmv.
- nickysielicki 6y agoAdvice to young devs: if you aren't writing C#, don't use Windows.
- izacus 6y agoOr in other words: Don't fight your system. You have so much other problems to solve that fighting your own operating system is just a waste of time.