Switching GCC version

I am using 6.3.2 and I want to change the default gcc from 2.95.3 to 3.3.5 but I can’t seem to do it. I tried editing this file:
/usr/qnx632/host/qnx6/x86/etc/qcc/default

I changed it to DIR=gcc/3.3.5/

But gcc -v still gives 2.95.3…am I missing something?

Changing that file changes what qcc uses by default not gcc.

I think if you do a “which -laf gcc” it’s just a link to the 2.9.5 version of gcc, so I guess you can just change it to point at the 3.3.5 version. But you may have to change a bunch of links…maybe there is a better way??? Sorry, I always use qcc to compile for QNX.

Jason

Okay, how does one make qcc the default compiler?

qcc should be the default compiler, since qcc internally will call gcc

^^

Okay, this becoming circular. How do I make qcc call gcc 3.3.5 instead of 2.95.2?

JCT,

In /usr/qnx630/host/qnx6/x86/etc/qcc/gcc

There is a file called default along with a 2.95.3 and 3.3.5 directory.

The contents of the default file are ‘DIR=2.95.3’

I suspect changing that to 3.3.5 will automatically have qcc call 3.3.5

This is on a self hosted system (not the Momentics IDE). In the IDE, there is a specific setting you can change to use 3.3.5 as the default compiler.

Personally, I manually specify the compiler in my CFLAGS option in my Makefile. That way I always know I’m using the 3.3.5 compiler in case someone forgets to change that file on a new install etc.

Tim

That did it. Thanks all!

try calling:

qcc -V3.3.1,gcc_ntox86 -set-default

where, gcc_ntox86 is your target system (e.g. gcc_ntoppcbe, …)
This should automatically change all needed files to your defaults.

oh yeah, otherwise, if you do not wish tu take default,
just add the

-V3.3.1,gcc_ntox86

to your compiler command ^^

That worked, thanks all!

Or maybe not.

gcc -v
gcc version 2.95.3

gcc -v will always 2.95.3 as long as you do not move the symlink

call qcc with apropriate parameters