For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > January 2005 > Code requires g++ 2.95.3, what should I do?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Code requires g++ 2.95.3, what should I do?
b83503104@yahoo.com

2005-01-27, 3:57 am

Hi,
Is there any service/website where I can compile and build my code
using the outdated g++ 2.95.3? Instead of hacking the code (which now
produces many errors), or removing the newer g++ and installing the old
one?
Or there are other solutions?
Thanks!

Dave Uhring

2005-01-27, 3:57 am

On Wed, 26 Jan 2005 19:56:55 -0800, b83503104@yahoo.com wrote:

> Hi,
> Is there any service/website where I can compile and build my code
> using the outdated g++ 2.95.3? Instead of hacking the code (which now
> produces many errors), or removing the newer g++ and installing the old
> one?
> Or there are other solutions?


Build gcc-2.95.3 on your own machine or install it from sunfreeware.com or
Sun's Companion CD.

Rich Teer

2005-01-27, 3:57 am

On Wed, 26 Jan 2005, b83503104@yahoo.com wrote:

> Is there any service/website where I can compile and build my code
> using the outdated g++ 2.95.3? Instead of hacking the code (which now
> produces many errors), or removing the newer g++ and installing the old


Assuming the errors are correctly produced, fix your code. Kludging
around it with an out-of-date compiler is just asking for trouble.

The solution Dave suggested is a good workaround, but you should fix
your code.

--
Rich Teer, SCNA, SCSA, author of "Solaris Systems Programming"

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
Dave Uhring

2005-01-27, 3:57 am

On Thu, 27 Jan 2005 05:12:27 +0000, Rich Teer wrote:

> Assuming the errors are correctly produced, fix your code. Kludging
> around it with an out-of-date compiler is just asking for trouble.
>
> The solution Dave suggested is a good workaround, but you should fix
> your code.


My solution sucks if the OP's program links to libraries compiled with a
modern c++ compiler. Fixing the code is indeed the correct solution.

Alex Zarutin

2005-01-28, 3:58 am

I would probably leave the decision to fix the code or install the g+
2.95.3 on the author of this topic. Answering on the direct question, I
would not recommend you to install the build package from
sunfreeware.com, because it will go to the same /usr/local

The probably the easiest way is to compile the gcc 2.95.3 from source
code and install it whatever you want. I actually got the same issue
trying to learn Rich Teer's book on the box with GCC 3.3.something
installed. His "GCC requirement" is using GCC 2.95.2. So, in order to
avoid fighting with various compiler versions, I just installed the
second one from source. For gcc 2.95.3 it should be the same as for
2.95.2 (or at least I hope so - I changed all my .2 to .3 in the
step-by-step info below). So I have both installed on my SUN box.

1. Download the binary from
ftp://ftp.sunfreeware.com/pub/freew...c-2.95.3.tar.gz to the
directory called /export/home/gcc_2.95.3_src/

2. Extract the source from archive
gunzip gcc-2.95.3.tar.gz
tar -xvf gcc-2.95.3.tar

3. Create the directory /usr/local/gcc/gcc-2.95.3
mkdir /usr/local/gcc
mkdir /usr/local/gcc/2.95.3/

4. Go the /export/home/gcc_2.95.3_src/gcc-2.95.3 and do this
../configure --prefix=/usr/local/gcc/2.95.3/
make CC=gcc LANGUAGES=c
make bootstrap
make install

5. Make sure that you set the PATH to your new GCC and run
gcc -version

Rich Teer

2005-01-28, 3:58 am

On Thu, 27 Jan 2005, Alex Zarutin wrote:

> code and install it whatever you want. I actually got the same issue
> trying to learn Rich Teer's book on the box with GCC 3.3.something
> installed. His "GCC requirement" is using GCC 2.95.2. So, in order to


Well, that version of gcc isn't necessarily a requirement, it's just
the one I happened to test the examples with.

Thanks for buying my book, BTW!

Cheers,

--
Rich Teer, SCNA, SCSA, author of "Solaris Systems Programming"

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com