about compiler

Pages: 12
can any body tell about a good compiler for windows 7 except vusial studio..??
code::blocks
the webpage is www.codeblocks.org, i use it and its very good
Do you mean compiler or IDE?
for compiler, i use GNU GCC compiler
GCC is awesome
I've heard before on here that GCC is the best. Can somebody tell me why it's better than Visual C++?
I love using visual studio than code blocks because i can easily view my applications compiled by visual studio outside visual studio but when i compile in code blocks i can't do it,i will have to view it through code blocks but visual studio not necessary......... Visual studio is the best
@tolustar, you can use Code::Blocks to compile programs using Visual Studio compiler too.
Yeah I use Visual Studio because it's what I was trained to use to a degree. The only thing I have left to figure out specific to the compiler itself is how to extract the program I write within it from the compiler so I can run my own program on its own and not within Visual Studio.
I love using visual studio than code blocks because i can easily view my applications compiled by visual studio outside visual studio but when i compile in code blocks i can't do it,i will have to view it through code blocks but visual studio not necessary......... Visual studio is the best

Whatever your problem might be, it's not related to the compilers you're using, it's just that you're doing it wrong.
GCC follows c++ standards very well and does not include any non-standard c++ code as much as it can.
in visual studio, c++ is influenced by .net framework e.g. you can add Garbage Collaction to a class via a _gc keyword (I don't remeber the syntax ;) ) in class definition which is not standard in c++, and many more keywords.
Also GCC supports many C++11 features that VS does not support yet.

http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport

GCC supports almost all of them.
GCC has just a big disadvantage. code compilation time, takes more than other compilers, I don't know why.
@majidkamali1370
Both GCC and VS implement some language extensions that aren't standard. And both implement many C++11 features, neither supports all. AFAIK you cannot enable GC in unmanaged C++ in VS.
@naraku9333
Yes, both have non-standard c++ extensions but VS's is much more.
AFAIK, you can use GC as far as you don't use multiple inheritance.
> Both GCC and VS implement some language extensions that aren't standard.

You don't have to use the non-standard extensions.

Unfortunately, 'conform to the standard' is not the default in either. So

GCC: > g++ -std=c++11 -pedantic-errors ....

Microsoft: > CL /Za ...

Last edited on
AFAIK, you can use GC as far as you don't use multiple inheritance.


It has nothing to do with inheritance, it has to do with the target. You can only use the .NET garbage collector if you are targeting a .NET assembly. If you are targeting native binary, then there is no implicit garbage collector and C++/CLI (or the older "Managed Extensions for C++") language extensions are not enabled.
Regarding Visual Studio language extensions (enabling /Za switch), without them you cannot compile any C or C++ program, just tried with this sample code (created empty project, no precompiled headers):
1
2
3
4
5
6
#include <iostream>
#include <Windows.h>
int main() {
	std::cout << "Hello, World!" << std::endl;
	return 0;
}


If I remove <windows.h> the code compiles, but without windows.h header we cannot write much for windows platform, don't you think ?
> If I remove <windows.h> the code compiles,
> but without windows.h header we cannot write much for windows platform, don't you think ?

Yes, but then if we are writing code specifically for the windows platform, the code is not portable anyway. Why worry about non-standard extensions; they are not going to hurt us.

The idea is that if a program consists of, say, 20 translation units, we should still be able to write, say, 16 of them in a completely portable manner.
Last edited on
majidkamali1370 wrote:
Also GCC supports many C++11 features that VS does not support yet.


Does that include the latest version? (VS 2012)
Does that include the latest version? (VS 2012)


In this link there are first versions that implement features

http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport
Pages: 12