• Advertisement
Sign in to follow this  

gcc - do you recommend it?

This topic is 3292 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm thinking about moving from VC++ to gcc, but before I do that I need to hear some opinions about it from people who use it. Is it any good? Does it have a good intellisense?

Share this post


Link to post
Share on other sites
Advertisement
GCC is just a compiler, not an IDE. VC++ is a compiler and IDE. If you use GCC, you'll need to get an IDE as well - on it's own GCC is just a command line utility.

Share this post


Link to post
Share on other sites
What Evil Steve said; gcc is merely a compiler. If you want an IDE using gcc I would suggest Code::Blocks or perhaps Dev-C++ (although the latter is not actively being developed anymore).

Share this post


Link to post
Share on other sites
I love gcc BECAUSE of the fact that it is just a compiler. I prefer using plaintext editors, because the bright colors of most IDE's are very distracting to me :P

If you are the same way then you will probably like gcc, but otherwise you should definitely find some sort of IDE.

Share this post


Link to post
Share on other sites
I recommend Code::Blocks if you really want to switch to gcc, however, unless you're aiming for cross platform development, don't (and even so, its not that hard to adjust your VC++ code to compile on other POSIX OS if you know what you're doing).

GCC itself is a very good compiler, but MinGW, the Windows port is a mess, and an outdated mess at that, if you like the command line environment, you can go with cygwin, just remember to pass the -mno-cygwin flag so you don't have to a) distribute the cygwin unix layer dll with your programs and b) open source your projects.

Share this post


Link to post
Share on other sites
If you want to stick with Windows I don't see any good reasons to move away from VC++. If you are moving to Linux I can recommend NetBeans and Eclipse both work nice with gcc. For better optimization you can also try llvm-gcc.

Share this post


Link to post
Share on other sites
If you want to get GCC, download Code::Blocks, which comes packaged with MinGW. MinGW is the popular Windows distribution of GCC. Don't even give Cygwin a second look. Alien territory... GCC doesn't have MFC but it definetely still has STL.

To you buzzkills, some of us don't like spending 100+ dollars every couple of years to stay up-to-date with Microsoft's compilers. VC++ has way too many non-standard extensions. The express editions are horrible. If it doesn't come with MFC, I don't want it.

Share this post


Link to post
Share on other sites
Quote:
Original post by MortusMaximus
I love gcc BECAUSE of the fact that it is just a compiler. I prefer using plaintext editors, because the bright colors of most IDE's are very distracting to me :P

You can still run MSVC from the command line. You'll generally need to run a batch file called vsvars32.bat to set up the environment variables, but once you run that you can just call cl.exe.

Share this post


Link to post
Share on other sites
Quote:
Original post by kittycat768
If you want to get GCC, download Code::Blocks, which comes packaged with MinGW. MinGW is the popular Windows distribution of GCC. Don't even give Cygwin a second look. Alien territory... GCC doesn't have MFC but it definetely still has STL.
MinGW is not a good option - and certainly not better than VC++. If you feel for some reason that you must use MinGW, at least hunt down the (fairly uncommon) builds using GCC 4.3+.
Quote:
To you buzzkills, some of us don't like spending 100+ dollars every couple of years to stay up-to-date with Microsoft's compilers. VC++ has way too many non-standard extensions. The express editions are horrible. If it doesn't come with MFC, I don't want it.
Lack of MFC support is the only real difference I have found between the express and standard editions of VC++, and GCC doesn't support MFC either. Even as a long term Microsoft-detractor, I have to say that Visual Studio is one of the best IDEs available, and open-source solutions such as Code::Blocks do not hold a candle to it.

Share this post


Link to post
Share on other sites
Quote:
Original post by HomerSp
or perhaps Dev-C++ (although the latter is not actively being developed anymore).
Don't use Dev-C++.

Quote:
Original post by kittycat768
The express editions are horrible. If it doesn't support MFC, I don't want it.
Considering the alternative you recommended doesn't support MFC either, are there any other reasons you consider the express editions to be horrible?

Quote:
Original post by someboddy
I'm thinking about moving from VC++ to gcc
Is there any particular reason you're considering the change? It may be relevant to the discussion if you're considering it based on a problem that GCC wouldn't actually fix for you or if there's some easy way of changing the behavior in VC++ you're simply not aware of, and given you referred to the IDE rather than just the compiler we may be able to make more recommendations in that area as well.

[Edited by - jbadams on January 13, 2009 11:20:19 AM]

Share this post


Link to post
Share on other sites
I still use MSVC++ to edit my code, and just compile using GCC via makefile or superlongcommandlinestatements. Some people recommend emacs as a good replacement for MSVC++'s IDE.

Share this post


Link to post
Share on other sites
Quote:
Original post by taby
I still use MSVC++ to edit my code, and just compile using GCC via makefile or superlongcommandlinestatements. Some people recommend emacs as a good replacement for MSVC++'s IDE.


I use XEmacs, you don't really want to recommend an iteration of Emacs to newcomers or people unfamiliar with Unix environments.

Share this post


Link to post
Share on other sites
I use cmake to build my stuff, I never really liked having the build system tied into the IDE anyway. Also visual studio's project and build management is awful.

I really fail to see what people find so good with visual studio anyway. I've extensively used each version of it since 6.0 to 2008 in my different jobs, and when it comes to c++ it's becoming worse and worse. It's slow as hell, hangs for no good reason all the time (it even take ages to open a simple text file sometimes), code completion works so rarely that I can't ever rely on it, the project management is terrible and don't get along well with any SCMs (including microsoft's own TFS), the build system is very limited, and the project configuration UI is crap (come on, why does it still have to be in a fixed size dialog as of 2008?)

Nowadays at home I use kate under kde. Only thing it misses is completion, but my code is either simple enough not to need it or template heavy stuff where code completion usually fails anyway.

If I really needed completion and using the ide as a gdb front end, I guess I'd use kdevelop, code blocks or something like that.

Share this post


Link to post
Share on other sites
For the reason I want to move:

There is nothing wrong with VC++, I just don't think Microsoft released a Linux version of it...

Share this post


Link to post
Share on other sites
Quote:
Original post by kittycat768The express editions are horrible. If it doesn't come with MFC, I don't want it.


It doesn't come with the express editions true, but the headers and libs for MFC 6.0 and ATL 2.1, 3.0, and 7.0 ship with the WDK which is available for free from Connect.

Share this post


Link to post
Share on other sites
Quote:
Original post by someboddy
For the reason I want to move:

There is nothing wrong with VC++, I just don't think Microsoft released a Linux version of it...


You can use CMake to manage your projects, that way you can use VC++ on Windows and Code::Blocks or Eclipse on Linux without having to maintain multiple build systems.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kwizatz
Quote:
Original post by someboddy
For the reason I want to move:

There is nothing wrong with VC++, I just don't think Microsoft released a Linux version of it...


You can use CMake to manage your projects, that way you can use VC++ on Windows and Code::Blocks or Eclipse on Linux without having to maintain multiple build systems.


Really? That's great. Just what I need. Thanks dude!

Share this post


Link to post
Share on other sites
I'm surprised that some people think so low of MinGW. I've used it primarily for nearly a year, and I haven't had a single problem with code or compiling. I also like the ability of gcc to compile for almost any platform on almost any platform. On top of that, there's tons of useful features that are included in gcc, such as --no-implicit-templates. My single complaint is that I have yet to find an IDE that I am really happy with, although I have yet to try Code::Blocks. I am currently using NetBeans, which is full of features, but lacks in some areas such as performance (which should never be an issue with an IDE). My experience with Dev-C++ was pretty awful. The IDE that I have had the best experience with is MSVC6.0, which sadly doesn't support MinGW.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Quote:
Original post by MortusMaximus
I love gcc BECAUSE of the fact that it is just a compiler. I prefer using plaintext editors, because the bright colors of most IDE's are very distracting to me :P

You can still run MSVC from the command line. You'll generally need to run a batch file called vsvars32.bat to set up the environment variables, but once you run that you can just call cl.exe.

Yup and the last couple of versions of Visual Studio have made this a no-brainer by actually putting a visual studio 200x command prompt shortcut in your start menu!

Share this post


Link to post
Share on other sites
Quote:
Original post by Daggerbot
I'm surprised that some people think so low of MinGW. I've used it primarily for nearly a year, and I haven't had a single problem with code or compiling.
The problem isn't with GCC, it is that MinGW uses a very outdated version of GCC, and has caused some issues shoehorning it into a Windows environment. Pick up the unofficial GCC 4.3+ version, if you prefer.

Share this post


Link to post
Share on other sites
There are versions of MinGW with GCC 4.3, I wouldn't call that outdated... (and it's nothing unofficial, it's just supposedly not as stable)

Also, GCC is a much better compiler to code with since it is much more standard compliant, and will produce more useful error messages.
I suggest, however, that you write code that is independent of the compiler: stick to standard C++ that will compile everywhere.

Share this post


Link to post
Share on other sites
Quote:
Original post by someboddy
I'm thinking about moving from VC++ to gcc, but before I do that I need to hear some opinions about it from people who use it. Is it any good? Does it have a good intellisense?


The compilers that come with GCC are fine. Even the older MinGW 3.4.5 editions are still better than many other Windows compilers. The newer 4.2.x and 4.3 builds are rather similar to the more recent versions of Microsoft's C++ compiler, at least in terms of standards support. I've had experiences where each has been better at optimizing different pieces of code.

I use them both and have a "neutral" but powerful text editor as my "IDE". In fact most of my projects start out supporting 6 or 7 compilers, but it's often the case that only GCC and VC++ are left after a while as the others can't compile modern C++ code to the same degree.

It's usually not a particularly large matter to port from one to the other if your build system has good support for multiple compilers.

The only thing about MinGW is that is a big negative in my opinion is that the wide character support in its standard library isn't very good. I tend to use utf8 in most places, so this doesn't affect me. But it may be an issue for you.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kwizatz
Quote:
Original post by someboddy
For the reason I want to move:

There is nothing wrong with VC++, I just don't think Microsoft released a Linux version of it...


You can use CMake to manage your projects, that way you can use VC++ on Windows and Code::Blocks or Eclipse on Linux without having to maintain multiple build systems.


How close is CMake to the make system used by most Linux distros? I really don't remember the name. It's always just been "make" to me. I got MSYS for Windows but I didn't like it too much. I believe that Code::Blocks supports custom makefiles, but I have no idea what build system it tries to emulate.

Share this post


Link to post
Share on other sites
Quote:
Original post by kittycat768

How close is CMake to the make system used by most Linux distros? I really don't remember the name. It's always just been "make" to me. I got MSYS for Windows but I didn't like it too much. I believe that Code::Blocks supports custom makefiles, but I have no idea what build system it tries to emulate.


A majority of packages used by linux use autoconf. It's basically a huge shell script (configure), generated by other shell scripts, and which detects libraries installations etc. and generate the makefiles.

cmake operate the same way but is much easier to use. It also have several backends, so by default under linux you use it to generate makefiles, but it can also generate code blocks projects and other stuff.

Under windows, it can generate solutions and projects for visual studio, or makefiles suitable for nmake (distributed with visual studio), using cl.exe (the visual studio compiler) directly.

It abstracts a lot of option settings, and provide modules to locate various library installation paths at configuration time (you can implement your own). It supports building in a completely separate directory from the source. You can even describe where to install your files and it can then automatically generate tarballs, debian packages or even nsis installers for windows (you can include installation-specific informations such as the nsis installer icon etc.).

There's a lot of built-in build functions, unlike make where you have to painfully write every rule by hand. So you can for instance build a dll/shared object just by writing something like:

add_library( name SHARED xxx.cpp yyy.cpp zzz.cpp ) and it'll do the right thing according to your target and compiler. You do need a bit of compiler specific option setting (cmake 2.4 wasn't setting -fPIC everywhere needed automatically when using gcc for instance), but that's only a couple IFs to test for the compiler type to stick somewhere.

It's really nice to work with. My engine involve some messy process where an idl compiler is built first, then used to generate a bunch of headers needed to build subsequent things. I've easily been able to set this all up with cmake in a way where all the required dependencies work perfectly well. I tried to use scons in the past and it became messy quickly when doing slightly complicated stuff.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement