LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   g++ 3.4.4 installation problem in Ubuntu 9.04!!! (https://www.linuxquestions.org/questions/linux-software-2/g-3-4-4-installation-problem-in-ubuntu-9-04-a-759987/)

Suranjit 10-06-2009 02:44 AM

g++ 3.4.4 installation problem in Ubuntu 9.04!!!
 
Dear All,

I am a new user and I'm using Ubuntu 9.04 in my laptop. The C++ compiler that was installed by default is g++ 4.3.3.
But for some urgent cause I need to install g++ 3.4.4. I have to run some .cc code (ns-2.29 broadcast algorithms) which were written in g++ 3.4.4.

Could anyone please tell me how can I install g++ 3.4.4 and remove g++ 4.3.3?

Your help is really appreciated.
Thanks,
Suranjit

lutusp 10-06-2009 03:29 AM

Quote:

Originally Posted by Suranjit (Post 3709229)
Dear All,

I am a new user and I'm using Ubuntu 9.04 in my laptop. The C++ compiler that was installed by default is g++ 4.3.3.
But for some urgent cause I need to install g++ 3.4.4. I have to run some .cc code (ns-2.29 broadcast algorithms) which were written in g++ 3.4.4.

Could anyone please tell me how can I install g++ 3.4.4 and remove g++ 4.3.3?

Your help is really appreciated.
Thanks,
Suranjit

Here's the problem. If you succeeded in installing the old compiler, it wouldn't run. If it ran against all odds, it would not compile the target program for lack of legacy libraries. If it compiled the program against all odds, the program then wouldn't run.

The solution is to find an updated version of the original program's source code. I offer this advice after years of trying to provide legacy applications in the face of compiler changes that invalidated my source code.

Suranjit 10-06-2009 04:01 AM

Quote:

Originally Posted by lutusp (Post 3709258)
Here's the problem. If you succeeded in installing the old compiler, it wouldn't run. If it ran against all odds, it would not compile the target program for lack of legacy libraries. If it compiled the program against all odds, the program then wouldn't run.

The solution is to find an updated version of the original program's source code. I offer this advice after years of trying to provide legacy applications in the face of compiler changes that invalidated my source code.

-->
Thank you for your suggestion. There are no updates for those codes and I tried to compile those codes with g++ 4.4.3 but unfortunately there were some errors such as "...... : error: expected `)' before ‘*’ token" but when I checked the code I was not able to find any bug.... Still now I am wondering how to fix those errors to run those codes !!!!!!!!!

lutusp 10-06-2009 04:37 AM

Quote:

Originally Posted by Suranjit (Post 3709280)
-->
Thank you for your suggestion. There are no updates for those codes and I tried to compile those codes with g++ 4.4.3 but unfortunately there were some errors such as "...... : error: expected `)' before ‘*’ token" but when I checked the code I was not able to find any bug.... Still now I am wondering how to fix those errors to run those codes !!!!!!!!!

If you are determined to compile this application and if there really are no updates by the originator, you will have to edit the source to make it comply with current standards.

Most such errors are pretty easy to sort out, especially is you understand C or C++ as applicable.

AlucardZero 10-06-2009 08:14 AM

There's no easy way to install g++3.4 on Ubuntu 9.04. You could compile it from source though.

knudfl 10-06-2009 03:39 PM

You can have as many compilers as you want, but Ubuntu 9.04 has
a limited selection compared to earlier versions.
'g++-4.1' can be installed from the repo.
'g++-3.4' is available from "hardy-updates"
http://packages.ubuntu.com/hardy-updates/g++-3.4

sudo dpkg -i \
cpp-3.4_3.4.6-6ubuntu5_i386.deb g++-3.4_3.4.6-6ubuntu5_i386.deb \
gcc-3.4_3.4.6-6ubuntu5_i386.deb gcc-3.4-base_3.4.6-6ubuntu5_i386.deb \
libstdc++6-dev_3.4.6-6ubuntu5_i386.deb

Examples using g++-3.4 :
./configure CXX=g++-3.4
make CXX=g++-3.4
.....

AlucardZero 10-06-2009 05:21 PM

Quote:

Originally Posted by knudfl (Post 3710096)
'g++-3.4' is available from "hardy-updates"

But Hardy is 8.04 and he's on 9.04, that's two full releases old. I highly doubt that the packages will install cleanly.

knudfl 10-06-2009 05:51 PM

@ AlucardZero

The packages shown in post # 6 are installed on my
Ubuntu 9.04 and 'g++-3.4' works perfectly.

A lot of old packages will work with no problems
on a current version of a Linux OS.
.....

Suranjit 10-09-2009 01:15 AM

Thanks all for your quick replies.
I discussed with my Prof and he suggested me to modify those code instead of spending my time on installing g++-3.4.4, because it could generate other problems (he wrote those code for ns-2.29 and it was compiled on g++ 3.4.4). I hope that I will be able to modify those codes soon.

Thanks again.

>> Suranjit <<

John VV 10-09-2009 03:08 AM

you might want to read the gcc porting guide
to gcc 4.3
http://gcc.gnu.org/gcc-4.3/porting_to.html
and to gcc 4.4
http://gcc.gnu.org/gcc-4.4/porting_to.html

manuals
http://gcc.gnu.org/onlinedocs/


All times are GMT -5. The time now is 03:05 AM.