GNU CC and Windows - windows

I'm a bit confused about the options for using GNU CC on Windows.
If I want to primarily develop console applications (as opposed to GUI apps) what do I need? Where do Cygwin and MinGW figure? For example, if I use the NetBeans IDE C/C++ option, that requires installation of Cygwin.
Are there any options which would allow Console application development without Cygwin?

Both MinGW & Cygwin give you the gcc compiler but if you use MinGW you don't need to install Cygwin because it uses native Windows libraries rather than Cygwin libraries
Cygwin is more than just compilers, it tries to provide a UNIX programming environment by building a lot of UNIX libraries on top of Windows SDK.

You could install CodeBlocks IDE oder DevCPP ide. If you do not require special posix api's then you do not need to install cygwin.

You really really should check out Visual C++ Express. It makes developing on windows A LOT easier. I it is free and the Visual C++ is the preferred way to develop windows apps. ANd yes, you can make console applications too.

That clarifies things. I'm not particularly interested in a *nix-like environment. I was more interested in getting a GNU C compiler that conforms closely with C99 (which I believe the latest GCC compiler does) and using it as a C learning exercise (hence console rather than GUI apps)
It appears to me that NetBeans IDE/Cygwin option installs an earlier version of the compiler.
So, it appears that MinGW is what I am looking for if I want to use GNU C. Incidentally, the free Pelles C compiler/IDE has a very full C99 implementation.

You can use vc express for concole apps if you wish, or really any compiler for win platform.

MinGW can support many languages as well as GNU C Compiler. It also comes with msys package that you can simulate UNIX environment. Cygwin does the same thing as msys does. I'd advice you to install MinGW with full msys support.

Related

VS2010 with C++11 all feature support using QT creator

I would like to ask a question about VS2010 IDE environment with all the C++11 features. Currently we need to build our software where some libraries need C++11 all feature support but we are now still running VS2010 environment and currently we are not upgrading our VS2010 to VS2017 at this moment.
So Is there any way to build these library with alternative mentods like installing QT creator on Windows platform so that can use g++ 4.9.3 or later same as on linux ubuntu? I found some website mentioning about Cygwin installed on Windows but seems not clear how to do.
Thanks for your help!
The QT installer provides binary versions built with MinGW as well as MinGW itself, so just use those.

What does TDM stand for in "TDM-gcc"?

I have searched for this for many site and failed. But what does TDM stand for in "TDM-gcc"? It confuses me when I want to choose gcc as the compiler. So, what's the difference? Should I choose TDM or NON-TDM? Or is TDM only for minGW on Windows platform?
The official TDM-gcc site don't even explain it...
TDM-GCC is a GCC distribution on Windows. TDM stands for Twilight Dragon Media, the project's name.
Since you want GCC on Windows, you've 3 popular options
Mingw-w64
MinGW
TDM-GCC
Also choose the right exception and threading model. Details: What is difference between sjlj vs dwarf vs seh? and mingw-w64 threads: posix vs win32.
If you not only want GCC but also a Unix-like shell with all the bin, core and findutils, you may use Cygwin or the lighter MSYS2. I personally prefer the latter; it also has a package manager and you get frequent updates for the packages installed.

Does it possible to run C++ apps for every type of OS?

I would like to use C/C++ for coding my apps, but I need my apps running on all versions of Windows from XP to Win8, independently by any platforms, run time libraries and so on.
Briefly: What kind/type of C/C++ I suppose to use, be able to run my apps on every type of Windows without any additional installation, just default one. e.g Windows XP SP1
C++ can run on just about any OS, as long as you avoid (or, via conditional compilation, provide alternatives for) anything specific to one OS or version. Win32 code is almost all the same between versions; the main difference is added functionality in newer versions. Between Windows and, say Linux, though? Not so much. You kinda need to pick a platform, unless you want to either stick to text mode (which is pretty close between OSes, thanks to standards) or learn some whole other platform-neutral API like OpenGL, wxWidgets, GTK, etc.
As for which compiler to use, if you're sticking with Windows, I'd recommend Visual Studio. Microsoft has a free (Express) edition that will let you compile Win32 code or .net. (You'll need the paid version, or some playing around with the Platform SDK, to play with 64-bit though.) And the IDE isn't too bad either. If you just want a compiler, the Platform SDK has the same compilers VS has, and includes 64-bit support (and even a bunch of code samples and tools) as well.
As for being independent of any runtime libs: Every C++ compiler that's worth using has a runtime library. If you link statically against it, though, the parts you need will be embedded in your EXE. Alternatively, you have permission to distribute the runtime libs with your app (though you may need to install it via a package they provide, that you bundle together with your app...i forget how all that works).
All popular C++ compilers support XP up. You can statically link the runtime, or, for mingw, you can link against the runtime supplied with Windows.

windows version of the GDB frontend DDD

Is there a native (not cygwin) version of DDD available for download somewhere?
DDD has not been ported to Windows AFAIK. But there ARE native gdb, which can be perfectly built using MingW32.
You can also build Insight natively using Mingw32.
You can also give a try to BeaverDbg
There is also a GDB front-end for MS Visual Studio, called WinGDB. It supports both Cygwin and MinGW. You use it just like built-in debugger in VS. It's also possible to debug remotely on Linux via SSH.
Try the Affinic Debugger GUI. It is a native Windows application and is similar to DDD. It uses GDB as the backend.
For a cross-platform gdb frontend, Qt Creator comes to mind. It also does "native" cdb on Windows, but I am not sure that's what you are looking for.
Since there is no native windows (not cygwin) gdb, there can't be a native windows (not cygwin) ddd.

Producing 64-bit builds on Windows with free software

I have a C++ project that I've been developing in Microsoft Visual C++ 2008 Express Edition. It has come to the point that I'd like to port to 64-bit and continue development.
What is the best way to do this using free software?
My thoughts so far:
The Express Edition of MSVC doesn't come with 64-bit compilers, so I can install the Windows SDK to get these. I could then port my project files to nmake, and use the IDE just as a tool to debug and invoke my nmake scripts.. The downside to this is that nmake looks very poor. The example towards the end of this tutorial suggests that nmake cannot figure out source file dependences itself, and I don't know of anything equivelant to gcc -M that I could use.
Another option might be to use vcbuild from the Windows SDK to produce 64-bit builds from my existing vcproj files. Preliminary investigations show that this doesn't really work, as my project files don't have the 64-bit configurations present. (Perhaps I could fudge this by adding the 64-bit configurations to the vcproj files in a text editor.)
A final option might be to give up on MSVC, and port my project to the MinGW/MSYS toolchain.
You can use makedepend as an alternative to gcc -M. Here's a primer on this and other methods of generating dependencies.
You could also give the autoconf+automake combo a try, though it requires some work to make it use MSVC's compiler. Some have succeded at doing this.
If you want to use the Windows SDK compiler with GNU make or another build system, you could write a program/script that converts the output of cl.exe /showIncludes into a format that is compatible with your build system.

Resources