installing gcc on vista - gcc

I downloaded gcc 4.4.0 and unzipped it to C:\Program Files\gcc
forgive me for being a novice, but...now what? I read the install readme file but it's over my head. how do i get it to work?

If it were me, I would just start with cygwin in the first place. If you do, most of the Unix/Linux/BSD faq's and tutorials will "just work".

If you're new to gcc and want to start using it on Windows, I highly recommend the MinGW GUI installer.

If you want to do C/C++ programming for fun, Mingw is the simpler way to go about it. You'll also need some libraries to get you started.
Try: http://nuwen.net/mingw.html
It's a Mingw distribution based on GCC 4.3.3
It also contains: binutils, boost (with compiled headers), SDL, libbzip, libjpeg, libvorbis, freetype, and many other libraries.
EDIT: I'm not sure if any of the precompiled stuff will work on Vista. I've only tried it on WinXP.

If you want to Install, you can install Dev C++, which is actually MinGW with GUI. Dev C++ can probably be clubbed wth cygwin too though I havn't tried it out ever.
Even if the name says C++ in Dev C++, don't worry. I have tried and it does compile C programs as well. I am recommending Dev C++ because most people on Windows have a habit of using GUI for everything in contrast to be people from *nix background.
You can download it from here
It also includes GDB which is the debugger you can use. If you are don't know how to use gdb this tutorial can come handy.
Another aspect of Dev C++ is that it's development has probably ceased as no new versions have been released since Feb,2005 which is more than 4 years. People still use Dev C++ as it does it's job right. The latest version has GCC 3.4.2 bundled with it.
If you are interested in running the most latest or using newer versions of gcc, then you should try out wxDev C++ is an extension of Dev C++. The latest RC was made available somewhere in 1 yr back. It even has in built CVS support
Now since you require GCC 4.4.0 , it is available on MinGW site. Try to replace the older gcc dll in Dev C++/wxDev C++ with the newer one from this site.

You will edit the environment variable "PATH" to include C:\Program Files\gcc\bin.
(source: justrealized.com)
Then you can use gcc just like in Linux.

Related

Clang or GCC compiler for c++ 11 compatibility programming on Windows?

I was wondering which compiler is better to use on Windows OS (8.1) in temrs of compatibility to c++11's (and later 14) functions, liberies and features (like lambdas) and is also comfortable to use (less bugs).
I am a university student hence I'm not looking at the subject product-wise (even though I do like to code a bit more than just projects for my studies).
I am currently using eclipse luna IDE if it matters.
Notice that compiler != IDE.
VC++ is one of the most populars on Windows and depending on its version it has a good support for C++11 features. Check the list on the msdn blog to find out if there's everything you need.
Gcc is also ported to Windows and you can install MinGW to use it (4.8.1.4 at the moment of writing this). It is pretty complete on C++11.
Clang is also available for the Windows platform and it is also complete on C++11 support (plus it has good diagnostic messages), but notice that you will have to use another linker since clang doesn't ship with one (although there is an ongoing effort to write it: http://lld.llvm.org/)
All the compilers I cited above are pretty stable but, based on my experience, if you're looking for latest and greatest C++11/14/17 features, you might just want to go for gcc or clang (VC++ is slower in adding support for newest features and the compiler is undergoing a huge update to modernize). Just keep in mind that these are compilers and not just IDEs, an IDE is a front-end supporting program that uses a compiler undercover to compile files.
To set up a C++11 compiler, I suggest installing MSYS2, it has a package manager (pacman) that can install fresh versions of GCC, GDB, Clang and many libraries like SDL, Lua etc. Very easy to use too.
As far as GCC vs CLang goes - I really tried hard to make CLang work (which is presumably faster and more friendly than GCC - produces better warnings, etc.), but failed. Issues were that CLang (which comes with MSYS2) is hard-coded to use GCC linker which produces some strange linker errors when using libstdc++ (std implementation from GCC). libc++ (a new implementation designed to work with CLang) didn't worked for me on Windows either.
So you either try build CLang from sources and hope that some configuration will work with C++11 library, OR just stick with GCC which works just fine out of the box.
As IDE, I suggest to take a look at CLion. It is very comfortable (infinitely more user-friendly and intuitive than Visual Studio, IMO). Just install it and point it to the mingw64 (or mingw32) folder of MSYS2, it will auto-detect everything for you.
It only works with CMake projects though.

install and use GCC in windows 7 x64

I am new to GCC, don't know much about it. I want to install it on my Windows 7 64bit PC and use it for C, C++ and Java. The latest version is GCC-4.8.0. In their mirror links, I am getting option to download gcc 4.8.0.tar.bz2 and gcc 4.8.0.tar.gz and md5.sum. Please guide me, how should i proceed, to use GCC
On Windows, easiest way to get gcc is to install MinGW.
Most recent MinGW release has support for gcc 4.8 as well - but it may be not very stable at the moment.
These files are source archive files of the latest released GCC compiler.
As a newbie, you probably want a binary distribution, e.g. mingw or cygwin on Windows. (Then you might get an earlier version of GCC. 4.8 has just been released)
Alternatively, consider switching to Linux and install it on your machine. It will teach you a big lot (and almost all of Linux is free software so you can get its source code and study it).
Using Linux and GCC also gives you a significant advantage: you could use GCC plugins, e.g. develop your own MELT extension (MELT is a domain specific language to extend GCC, implemented as a [meta-]plugin). Neither Mingw nor Cygwin support GCC plugins.
PS. compiling GCC from source code is not easy for a newbie.
this is an older question but this was harder to search for than it should have been so I will post it here, http://gcc.gnu.org/wiki/WindowsBuilding is a quick guide to getting gcc4.8 running on windows. I am about to dive in to building it on my old windows-xp box. wish me luck.
I use codeblocks . You can follow this Youtube video for instructions:). Hope it helps!
http://www.youtube.com/watch?v=nNeySMSW8qU
You should really check out Code::Blocks (http://codeblocks.org/).
It's a good IDE which is easily set up to get you started.
To support Windows 64-bit though you should not use the MinGW compiler that comes with it. Instead get a separate binary of MinGW-w64 with 64-bit support.
You can get it from http://winlibs.com where you can also find tips on how to configure both Windows 32-bit and 64-bit compilers.

How do I compile a crosscompiler targeting Linux x64 on a Windows host?

I am planning on harvesting my gaming HTPCs spare cycles for compiling my software using distcc, but I will need to set up a cross compiler. The problem is that Google is sadly lacking in relevant information.
I think Cygwin is the purest form of evil, but is the easiest way of doing what you want.
You will just have to install the correct version of gcc from the cygwin installer.
This website has the answer here

Compiling Qt for Windows 98

I need to support Windows 98. The Qt documentation claims this is possible, but there are no instructions. The distributed binaries of Qt 4.6 don't run on Win98 and the majority of Qt applications I have sampled also don't. For several apps that do run on 98, I have asked authors how they did it, but the common answer is that it was accidental and they don't know what factors caused it.
In searching the forums for help, I found only guesses that turned out to be wrong. For example, one belief is that to compile for Win9x, you must build the tools and the apps on that platform. Yet, things I found to run were built on newer versions of Windows.
What is required to build the Qt dev tools and then applications for Win98?
How about cross-compiling from WinXP or Linux?
Are there specific components that can't be made to run on Win98?
Are there particular difficulties with dynamic or static linking for Win98 support?
Here is as far as I'm going to get on this:
You can target Windows 98 using MinGW or VC++ 6 SP5 from any Windows version. Cross-compiling from Linux is doable but not easy to set up.
Qt 4.4.3 was the last version officially tested on Win98. To run the distributed binaries on Win98, you need to install older versions of glu32.dll and opengl32.dll that are available from Microsoft. Due to an unresolved bug, Assistant will launch but can't load the help files. The alternate version in the bin directory, assistant_adp.exe, works fine. It seems the only other potential problem is that QtOpenGL may use features not available on older boxes.
Qt 4.5.3 appears to be still compatible except for WebKit, OpenGL, and Phonon. QtOpenGL expects OpenGL 1.5, which I don't know is even possible on older boxes. I didn't look into Phonon deeply enough to see exactly what the problems are. QtWebKit now requires Win2K or better. The distributed binaries work mostly OK. Assistant depends on QtWebKit, so will not launch, but assistant_adp.exe still works.
Qt 4.6.3 distributed binaries are now completely incompatible with Win98. It may be possible to get some things working with MinGW 4.4 and a lot of hacking.
Building Qt Creator requires Qt 4.6.0 and either MinGW 4.4 or VS 2008.
Wow...interesting mission.
So, basically - yes, there is windows 98 support for Qt. The problem is that there is one big IF. For example if you even try to set some different QTextCodec::codecForName, you'll have to provide 3rd party ttf for this purpose, because in most cases Win98 will not recognize it as valid. If you provide the exact error, while compiling it on win98 machine, I could help you.
"How about cross-compiling from WinXP or Linux?" - If you use ONLY Qt libraries everything goes fine. Otherwise in .pro file, you have to link these libs under win32 and unix conditions. So you could even forbid your code, to be compiled and executed in other systems...
"Are there specific components that can't be made to run on Win98?" - Of course. In .pro file you could include different libraries, for different operating systems.
"Are there particular difficulties with dynamic or static linking for Win98 support?" - As far as I know - there isn't.
//off - But it still strange, that someone want to write application for win98, today...

Is it possible to use GCC without Cygwin or MinGW?

GCC is a very well respected multi-language compiler (from what I've gathered). One thing I've not been able to definitively find out is: Is it possible to use GCC on windows without anything extra like Cygwin or MinGW?
I've learned that if you use GCC on Cygwin, there is a dependency on a DLL. If you use GCC with MinGW, you eliminate that dependency but you still must have MinGW to use GCC.
Is it possible to build GCC and utilize it by itself, completely native to Windows? Like Microsoft's Compiler? After reading around, my guess is no. But I'd still like more info, if possible.
If not, why does GCC require environments like Cygwin or MinGW? I understand this now. It is because GCC requires a Unix/POSIX environment. Why it does, it still beyond me.
I did find this and it helps but doesn't really answer my question: Why does GCC-Windows depend on cygwin?
To refine my question, I guess what I'm trying to understand why GCC can't stand on it's own -- Where I have just "GCC.exe".
For MinGW, you need MinGW in the sense that MinGW provides the implementation of the gcc language system. I don't see how your question makes sense - it's like "Can I use VC++ without installing VC++?"
To clarify: MinGW is the GCC compiler executable(s), headers and support objects. There isn't anything else. There is a related but independant package called MSYS which provides some posix utilities, but you do not need this in any way in order to use the MinGW version of GCC.
What is exactly the problem with mingw? And what is native?
mingw used to generate pretty much standalone binaries, and maybe that is even more native than MSVC's, which require msvcrt, a component that needs to be installed sometimes.
So maybe you could explain what you tried with mingw, and what the exact problem is.
To disable mingw's extra dependency simply don't use exceptions (-fno-exceptions), I haven't used cygwin so not sure.
I don't think so. I've had to compile some command line apps for people in the past and always had to use cygwin.
I think the biggest reason being posix compatibility, which is what cygwin strives to bring to Win32.
Linaro used to provide that long time ago, a GCC that runs naively on Windows without MinGW or Cygwin. I am currently using that GCC 4.9 on a Windows 10 PC to compile UEFI and it is working like charm.
https://releases.linaro.org/archive/14.09/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.9-2014.09_win32.zip
simply install wsl on your computer.

Resources