How to switch to gcc4?

I tried to compile some GNU projects (mc and several else) but I often get syntax errors during make. As far as I know, It may be related to old gcc version (2.95.3 by default in Haiku Alpha 1). I know that gcc 4.3 is included into this distro but I do not know how to switch to gcc4. Could anyone tell me how to switch to gcc4?

I think it’s done with the simple line

setgcc x86 gcc4
I’m no coder though…

HTH
Humdinger

I got into this problem too. Can’t this be dealt with by default? I don’t see how anyone would want to compile software with GCC2 unless for BeOS compatibility, to test something out, or there’s some other special case that would need it.

At present;
gcc2 R1 compatibility to be provided in R2 (mostly to support BeOS programs)
gcc4 R1 compatibility will not be in R2 (requiring re-compile and maybe code changes to programs), ie: new API for R2. For open-source, no issue ( other than re-doing the compiles ) but for closed source could lose software applications if gcc4 compiled and coder loses interest in Haiku.

That’s the reason why Haiku has stuck with gcc2 as the default compiler because gcc2 software will work on R2 no matter what. Though going to gcc4 would make things easier to work with for all coders and porters.

With R2 or R3 they will drop gcc2 support. Axel previously said it would occur with R3 but could change to R2 depending on R1 release & new programs to replace BeOS originals.

GCC2 for R1 is okay for now

GCC2 for R2 is a bad taste joke

You misunderstood me michael. GCC2 compatibility means programs compiled with GCC2 will run on R1 & R2. Haiku R2 will use latest GCC ( GCC4, GCC5, GCC6, etc. ) for default compiler. :slight_smile:

No more GCC2 compiling on R2.

Programs compiled with GCC4 on R1 will not work with R2. But I cannot say for sure. Just what I heard from developers.

setgcc x86 gcc4 - Thank you, it works. But I still can’t compile mc and some other programs. :frowning: It isn’t so easy as it seemed at first.

[quote=tonestone57]You misunderstood me michael. GCC2 compatibility means programs compiled with GCC2 will run on R1 & R2. Haiku R2 will use latest GCC ( GCC4, GCC5, GCC6, etc. ) for default compiler. :slight_smile:

No more GCC2 compiling on R2.

Programs compiled with GCC4 on R1 will not work with R2. But I cannot say for sure. Just what I heard from developers.[/quote]

I hope so \O/