12 ms·
W64devkit: A Portable C and C++ Development Kit for Windows
- dvfjsdhgfv 6y agoNote that it's "portable" in the Windows sense, i.e. you can unzip it and it should work. It has nothing to do with cross-platform portability.
- zoomablemind 6y agoPortable in a sense of have it on a flash-stick in your pocket, all working without need to install. I once created such a pocket-development setup, throwing in Fossil [0] for version control and project tracking, Notepad2 (notepad2-mod) [1,2] for editor. Actually, Git can also be set up for pocket, which then brings the whole MinGW for this. I wanted to fit Geany [3] for more like IDE experience. It's also Scintilla based, but needed GTK, so I chose not to bother back then. Android NDK can be set up this way too. It packs LLVM, so here it is another capable compiler to do the lab-work. Just learn to program in portable C way, that is know the platform-specific ways to do certain things (threads, network) and #ifdef it properly. However this is a whole other story about how this sort of portability could be handled. [0] http://fossil-scm.org http://fossil-scm.org [1] https://xhmikosr.github.io/notepad2-mod/ https://xhmikosr.github.io/notepad2-mod/ [2] http://www.flos-freeware.ch/notepad2.html http://www.flos-freeware.ch/notepad2.html [3] http://geany.org http://geany.org
- Jaruzel 6y agoWorth pointing out that this is a dockerfile, and not something you can just unzip-and-run on Windows.
- naikrovek 6y agoThe "Releases" section of the repo contains something you can just unzip-and-run on Windows.
- lucideer 6y agoThe 5th sentence in the linked article is: > For most users, the value is in the 78MiB .zip available in the “Releases” on GitHub. immediately followed by: > It’s “portable” in that there’s no installation. Just unzip it and start using it in place.
- deleted 6y ago[deleted]
- Jaruzel 6y agoIf you follow the link: https://github.com/skeeto/w64devkit https://github.com/skeeto/w64devkit It clearly says it's a dockerfile.
- ghusbands 6y agoAnd if you read the next sentence, it says "Docker is not needed to use the [dev] tools themselves".
- josephg 6y agoI've been eyeing off the new zig compiler for making portable binaries. I'm tempted to set it up for cross-compiling a native nodejs library I develop. The work Andrew Kelley has done to make zig cross compile is phenomenal. https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...
- simfoo 6y agoMy unusual application of Docker here is no exception. Most software builds are needlessly complicated and fragile, especially Autoconf-based builds. Ironically, the worst configure scripts I’ve dealt with come from GNU projects. They waste time doing useless checks (“Does your compiler define size_t?”) then produce a build that doesn’t work anyway because you’re doing something slightly unusual. Worst of all, despite my best efforts, the build will be contaminated by the state of the system doing the build. Completely agree, Autoconf needs to die. C++ builds don't need to be complex and fragile, even if many environments are supported. Just use a minimal CMake build and resist the urge to implement "clever" things in it.
- pornel 6y agoIf you do only minimal things, you will have fragile builds. The hacks are there not because people like adding complex code for no reason, but they're scars from broken builds. For example, requirements for what has to be static and what dynamic are different on Linux (distros want unbundling) and macOS and Windows (you can link to handful of things that ship with the OS). macOS is especially annoying, because if you're not careful, you'll link dynamically to homebrew's non-permanent locations. `find_package` doesn't do the right thing without clever non-minimal things around it.
- CJefferson 6y agoThe problem is, autoconf does a terrible job of supporting Windows, and actively rejects patches which would improve things (for example, it does very badly with spaces in filenames, which are common in Windows, for example "Program Files" and "My Documents")
- mehrdadn 6y agoEven Bazel doesn't support spaces in file names!
- vbezhenar 6y ago"My Documents" are called "Documents". You can also install your application into user directory, something like "C:\Users\Vladimir\AppData\Local\YourApplication", so no spaces necessary unless user name contains spaces (not sure if it's even possible). I'm not claiming that spaces should not be supported, but you can live without them.
- jcelerier 6y agoIn the same vein I've been using https://github.com/mstorsjo/llvm-mingw https://github.com/mstorsjo/llvm-mingw + lld + cmake + ninja on windows for over a year with great success, dev experience is much better than with MSVC.
- mbeex 6y agoMmmh Docker: It's still a problem to run Docker and VMware Workstation peacefully in parallel on Windows. The one prefers Hyper-V, the other the opposite: https://www.kauffmann.nl/2019/03/04/how-to-install-docker-on-windows-10-without-hyper-v/ https://www.kauffmann.nl/2019/03/04/how-to-install-docker-on... https://blogs.vmware.com/workstation/2020/01/vmware-workstation-tech-preview-20h1.html https://blogs.vmware.com/workstation/2020/01/vmware-workstat... This has to change first (the links giving some kind of hope).
- speedgoose 6y agoIf you don't want Hyper-V, you can run easily run docker in virtualbox with boot2docker, using docker-machine. Or you can setup a docker linux vm in vmware.
- mbeex 6y agoIt becomes only more complicated with nested virtualization techniques. Especially if you develop close 'to the metal'. I'm in 3D and image processing software, often with GPU interface requirements involved. I can reconcile some aspects in the virtual environments, but yet in the single case not all of them. On top of each other and according to experience, difficulties multiply.
- noisem4ker 6y ago>docker in virtualbox with boot2docker It comes packaged as Docker Toolbox.
- speedgoose 6y agoIt's legacy though. But I also notice that docker-machine isn't really updated anymore.
- frozenport 6y agoNot sure who this is for. More than half of Windows devs need to use a widget kit to make GUI applications, which does not appear included. Small console programs are already reasonably portable, with cmake solving most build problems. The latest version of MSVC seems to be catching up, and for Qt style applications you can just target msvc/llvm. Looks like the author choose to use some outdated practices and is struggling to get them to work.
- seventh-chord 6y agoIf you install visual studio, and then copy together all the files it adds to %PATH%, %INCLUDE% and %LIB%, and create a .bat script to set environment variables to point to your copies of these files you get a fully portable first-class compiler for windows with needed headers and libraries, zipped up to around 75 mB. Add remedybg as a debugger, and your editor of choice, and you never have to touch visual studio again.
- mehrdadn 6y agoThere's no way all the libraries zip up to 75MB. Literally just the x64 CRT lib folder by itself zips up to 96MB. I think you meant more like 1GB?
- seventh-chord 6y agoNot sure exactly what folder you mean, but I literally have a 75 MB zip file (or rather, it's a .7z file, zipping would make it slightly larger). Unzipped its 700 MB though.
- mehrdadn 6y agoWhich folder do you mean? I'm referring to C:\Program Files (x86)\Microsoft Visual Studio\2019\{edition}\VC\Tools\MSVC\{version}
- seventh-chord 6y agoIn that folder, bin includes files for compiling from x86/x64 to x86/x64, and in practice you only need one of the subfolders (in my case the x64 to x64 toolchain). The lib folder also includes binaries for x86 and onecore. If you remove all of those 7zip compresses the rest down to 25 MB.
- mehrdadn 6y agoYou're kidding right? Hostx64\x64 is like 51MB, lib\x64 is 428MB, together they compress to like 116MB. And then you forgot the ATLMFC x64 files which are 465MB and bring it to 230MB compressed.
- fsloth 6y agoAdvice 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.
- dominicl 6y agoRegarding msys2, for those who use GitHub the big news is that since 7 days msys2 is by default installed on the windows-latest target of GitHub actions: https://github.com/actions/virtual-environments/commit/c61145f2de073f08e8ce5316e31cdf2a5e0ddaa5 https://github.com/actions/virtual-environments/commit/c6114... I'm doing all local development on Linux and since msys2 is there by default getting the windows compile done is a bliss. Just need to bring msys2 to your path and all the rest (git, g++, linking, etc) is the same as in your Linux env. E.g. this is my prefix for the cross-build https://gist.github.com/dominicletz/5e50c49aa1bf30d2485f5bece177c82f https://gist.github.com/dominicletz/5e50c49aa1bf30d2485f5bec...
- stinos 6y agoThis has been the case for a long time on Appveyor which was is one of the reasons we stick to it for CI. Do you happen to have experience with it? I'm wondering if and why we should switch to github actions, for the repositories we have on github anyway.
- dominicl 6y agoHaven't tried Appveyor so can't compare experience. I'm a travis convert came for Windows with my open source project. Just glancing at the Appveyor pricing chart I guess my open source project would only get one parallel job on Appveyor while on GitHub Actions it's unlimited.
- fefe23 6y agoMy biggest problem with gcc for Windows is that libstdc++ does not support threads. There is a workaround with a pthread compatibility layer but that is just horrible and awful. I can't bring myself to do that. This has been an open issue for literally years now. But apparently nobody cares enough to fix it.
- matthewbauer 6y agoMy understanding is that while pthreads don't work, c++11 threads are supported.
- fefe23 6y agoIf only that were so! At least up to gcc version 9.3 it does not work. I will try gcc 10 soonish but I don't have high hopes. The whole reason I installed a cross compiler to Windows is so I could cross compile some search engine code I wrote that uses C++ threads. But if you have a copy of the header and run-time files from Visual Studio (there is a free edition of that now) you can actually use clang to cross compile for Windows from Linux just fine, including C++ threads.
- matthewbauer 6y agoIt looks like you need to set --enable-threads=posix when building GCC.
- spacechild1 6y agogcc on Windows uses winpthreads for C++11 threads, which works just fine (it automatically links with libwinpthread)... I can basically use the same threading code for all platforms (except the stuff that is necessarily platform dependent and therefore not part of C++11). I should note that I use msys2. So I'm wondering what you are missing? That being said, I often use my own STL like mutex class which wraps SRWLock on Window and pthtead_mutex_t on Linux/macOS.
- fefe23 6y ago
- matthewbauer 6y agoNote that this kit is using MinGW. That's not necessarily a bad thing but comes with all of the caveats you can read about. I wish the author mentioned it because it should definitely be a choice you make deliberately.
- heresie-dabord 6y agoFor the OP, many projects are a "mess" that don't agree with his opinions. "bash is a mess, git is a mess, cygwin feels wrong..." And M-Windows is a pristine example of orderly genius? I support his right to his opinions. But here he is, running Docker and a pile of opinions to build himself a portable C&C++ env on M-Windows. (To use gcc, no less.) Software in general is a mess. But that doesn't prevent great tools from being developed. There's a reason for the success of GNU and FOSS.
- txdv 6y agoWhat is M-Windows?
- heresie-dabord 6y agoYou are probably being facetious about this facetious short-form for the Redmond product.
- txdv 6y agohttps://github.com/libgit2/libgit2/pull/5507 https://github.com/libgit2/libgit2/pull/5507 I think git will get a stand alone git command line client in the future with no need for perl and such