What's a good command line compiler for Windows?

Red Squirrel

No Lifer
May 24, 2003
70,216
13,606
126
www.anyf.ca
Looking for something equivalent to g++/gcc in Linux. I found MinGW, but upon installing I realized that it's pulling stuff from Sourceforge. Well that VM is toast. Probably full of spyware now. Sourceforge has been known to inject spyware into executables that are hosted there.

Any options out there that are NOT hosted on Sourceforge?

Or can someone confirm of MinGW is safe? I do see g++ in a folder so it's kinda tempting to just use it, but I don't want something that is modified to inject spyware in my own programs or something.
 

Merad

Platinum Member
May 31, 2010
2,586
19
81
If you don't trust MinGW you're SOL, AFAIK. Clang is available for windows but I believe it relies on some MinGW tooling.

Microsoft's entire build system is (and has always been) usable from the command line, but it's very different and very clunky to use by hand when compared with linux tools.
 

Red Squirrel

No Lifer
May 24, 2003
70,216
13,606
126
www.anyf.ca
MinGW is not what I don't trust, it's Sourceforge. Is there a place to get MinGW that is not Sourceforge? Or a way to scan it to see if it's been tampered with?
 

Merad

Platinum Member
May 31, 2010
2,586
19
81
MinGW is not what I don't trust, it's Sourceforge. Is there a place to get MinGW that is not Sourceforge? Or a way to scan it to see if it's been tampered with?

I think your memory about sourceforce is a bit incorrect. A few years ago they took an application that still had an old version on Sourceforge, but wasn't actively maintained there (GIMP, I think?), and wrapped it with a "friendly" crapware laden installer. I don't remember them ever "injecting spyware into executables hosted there", and accomplishing that would extremely non trivial. If you're still worried, you can always ask the maintainer(s) of MinGW to verify the SHA1 of the files in question and compare them against what you downloaded.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
I think it was much more than one app that they crapware-enhanced, it was part of their business model at the time. But yes, I don't think they were caught tampering with the apps, just bloating up their installers.
 

Red Squirrel

No Lifer
May 24, 2003
70,216
13,606
126
www.anyf.ca
Hmmm so they only do it to stuff that they packaged themselves? So if it's the dev's own installer, or just a zip file, it should be safe?
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126
Installed MinGW from newen.net and no issue.

I also didn't have any issue installing software from Sourceforge.net in the past.
 

Gryz

Golden Member
Aug 28, 2010
1,551
204
106
I like Cygwin.
https://www.cygwin.com/

It might not be what you want. But I like it. I install it on all my windows machines these days. Very convenient. You can use Windows for all the windows-stuff. But if I want to do some shell (commandline) stuff, I can just fire a terminal-emulator with a shell inside. And it looks like Unix. Easy to install. And if you want, you can write c/c++ code and compile it as if it's Unix. I installed sshd, so now I can ssh into my Windows machine from anywhere on the net.
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126
Installed Ubuntu for Windows 10 (WIndows Subsystem for Linux (beta) yesterday. Very cool.

 

Murloc

Diamond Member
Jun 24, 2008
5,382
65
91
Installed Ubuntu for Windows 10 (WIndows Subsystem for Linux (beta) yesterday. Very cool.

that compiles stuff that runs on linux though AFAIK

OP maybe wants to compile stuff to run it on windows.
 

Gryz

Golden Member
Aug 28, 2010
1,551
204
106
The downside to Cygwin is that you have to redistribute a .dll with any binary you publish.
True. I use it for personal stuff. Not to develop software that I plan to distribute.

If I would do that, I would imagine I'd still develop on Cygwin. And then when development is done, take the source and compile/package it for different OSes. Cygwin is posix-compliant, so it shouldn't be much work to make it run on Linux flavors, FreeBSD, etc. There's probably more work to be done if you want to make your code run on MacOS, and especially Windows. But you'll need to do extra work anyway, if you want code to run on Unix, Mac and Windows.
 

Merad

Platinum Member
May 31, 2010
2,586
19
81
But if I want to do some shell (commandline) stuff, I can just fire a terminal-emulator with a shell inside.

It's worth pointing out that if all you want is a linux-ey terminal for windows, all you need to do these days is install git, which comes bundled with git bash and most of the coreutils.

Long term I have high hopes for the WSL, but right now it's more for doing Linux based projects from within Windows without a VM. If you try to use it as a general terminal for working with your windows projects and applications, things are a bit more complicated and sketchy.
 

Red Squirrel

No Lifer
May 24, 2003
70,216
13,606
126
www.anyf.ca
I like Cygwin.
https://www.cygwin.com/

It might not be what you want. But I like it. I install it on all my windows machines these days. Very convenient. You can use Windows for all the windows-stuff. But if I want to do some shell (commandline) stuff, I can just fire a terminal-emulator with a shell inside. And it looks like Unix. Easy to install. And if you want, you can write c/c++ code and compile it as if it's Unix. I installed sshd, so now I can ssh into my Windows machine from anywhere on the net.

Hmmm that may be an option too.

Though if the Mingw can be confirmed as being safe from having been altered by Sourceforge then I might just stick with that. I installed it not realizing it came from Sourceforge (the installer was pulling stuff from their servers) so I was kinda reluctant to run it.

As a side note, is there a way to compile stuff for windows under Linux? What would be nice is since I do all my coding in Linux I could have it compile the exe too as part of my compile script. Suppose I could use the gcc version for windows under wine if I want to do that. Then I can just have a compile.sh and compile_win.sh script.


Oh and speaking of git, that's something I need to learn more about and start using more for my projects, but I am working on implementing it for a project that more than one person works on as sending files by email and manually sorting them is just a pain. :p

Does the windows git version support SSH FTP? I don't want to actually open up the git port to the outside, but I can open SSH. Basically we will be "publishing" to a central git server that is on my network on a separate vlan. Is that something that the windows version supports? I did get it working fine in Linux with public keys so that it's automated, hoping I can do the same in windows as the other dev uses windows.
 
Last edited:

Merad

Platinum Member
May 31, 2010
2,586
19
81
I believe MinGW is available for linux, so you can use it. Git on windows is simply git. It works identically to the linux version.