I agree. I've been using Xcode since I started programming in C++ and it works like a charm. If you've never worked in an IDE/compiler before, it may look sort of intimidating/complicated but it's pretty simple.
If you'd rather work in something that's cross platform, I recommend Eclipse or Code::Blocks. Eclipse can give you trouble setting it up though (at least, it was pretty troublesome for me) but has a simple solution to fix it (a solution that I can't actually remember right now but I just know it's fixable).
You're probably going through more trouble than you need. Apple's spin of the Clang compiler is quite stable and probably supports OS X better than gcc does, now that Apple ceased to use it.
Is there any reason why you can't use the Xcode bundle? It doesn't just include an LLVM compiler toolchain, but a number of other essential programmers' tools (such as Ruby). You're not restricted to using the IDE if you don't like it, just remember to link against libc++ as by default Apple Clang does not.
EDIT: Also, most of LLVM's tools take the same command line arguments as their GCC equivalents. One notable exception is LLDB.
cd Downloads
host-001:Downloads user$ cd gmp*
-bash: cd: gmp-6.0.0a.tar.lz: Not a directory
host-001:Downloads user$ mkdir build && cd build
host-001:build user$ ../configure --prefix=/usr/gcc-4.9.2 --enable-cxx
-bash: ../configure: No such file or directory
Sorry but I`m now quite out of this thing…
Please someone tell me what I did wrong in the terminal window...
Apple doesn't bundle a compiler with the base installation of Mac OS, so you're trying to build a compiler without a compiler. Furthermore, I'm not even sure if GCC's standard libraries properly support Mac OS ever since Apple dropped them.
Getting Xcode really is the way to go here, even if it's bulky.
mkdir build && cd build
host-001:build user$ ../configure --prefix=/usr/gcc-4.9.2 --enable-cxx
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ../install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking compiler gcc -O2 -pedantic -fomit-frame-pointer -m64 ... no
checking compiler cc -O ... no
checking ABI=x32
checking compiler gcc -O2 -pedantic -fomit-frame-pointer -mx32 ... no
checking compiler cc ... no
checking ABI=32
checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer ... no
checking compiler gcc -O2 -pedantic -fomit-frame-pointer ... no
checking compiler icc -no-gcc ... no
checking compiler cc -O ... no
configure: error: could not find a working compiler, see config.log for details
I looked at config.log, but can`t understand much of it.
*/ Program to count blanks, tabs and newlines */
#include <stdio.h>
/* count lines in input */
int main()
{
int c, n1, n2, n3;
while ((c = getchar()) != EOF)
if (c == ' ')
++n1;
elseif (c == '\t')
++n2;
elseif (c == '\n')
++n3;
printf(" Number of blanks: %d\n", number of tabs is %d\n", number of newlines is %d.\n", n1, n2, n3);
return 0;
}
kjkjkjk jkjkj
lod D
Number of blanks: 32767
Number of tabs is 1828081753
Number of newlines is 32772.
What does those result mean? Now I got the program to work, anyway how can i avoid writing export PATH=/usr/gcc-4.9.2/bin:$PATH
every time I open terminal?
> What does those result mean?
¿why bother yourself in posting your current code?
you didn't initialised your variables
> how can i avoid writing (...) every time I open terminal?
1) put it in the startup file of your shell
a) don't use exotic paths for your installed programs