LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-28-2013, 06:25 AM   #1
lzw1012
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Rep: Reputation: Disabled
how to install gcc4.1 on ubuntu12.04


hello everbody:
I use ubuntu12.04,now I will use ns2.31 on ubuntu12.04,but when i install ns2.31 ,there have lots of errors.
i search some same questions,the ns2.31 need gcc4.1 ,but ubuntu12.04 only gcc4.4.
how can i install gcc4.1 on ubuntu12.04.

thank you very much!!!
 
Old 08-28-2013, 06:37 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

gcc / g++ version 4.1.2 : Links, post #47 here ..
http://www.linuxquestions.org/questi...532/page4.html
sudo dpkg -i gcc41-compat-4.1.2-ubuntu1210_i386.deb g++41-compat-4.1.2_i386.deb
... Then reboot, and the new compiler can be used.

Using : cd ns-allinone-2.31/ && export CC=gcc41 CXX=g++41 && ./install

-
 
Old 09-06-2013, 09:02 AM   #3
lzw1012
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
I do it step by step according to knudfl'post ,but I don't success . has it another way ??thank you all. especial knudfl'post ,thank you!
 
Old 09-06-2013, 10:03 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 3 .
Quote:
I do it step by step ...... but I don't success
May be you have a 64bits OS ? ?
Please try this command : $ uname -m <Enter>

The "i386" packages are usable on a 32bits (i686) OS only.

And :
ns2 is for a 32bits OS. Not everything may work, if it's 64bits.

-
 
Old 10-02-2013, 08:00 PM   #5
lzw1012
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
# 3 .

May be you have a 64bits OS ? ?
Please try this command : $ uname -m <Enter>

The "i386" packages are usable on a 32bits (i686) OS only.

And :
ns2 is for a 32bits OS. Not everything may work, if it's 64bits.

-

Thank you very much ! I now change to ubuntu10.10,but I get some message :


(Reading database ... 119129 files and directories currently installed.)
Preparing to replace cpp-4.1 4.1.2-27ubuntu1 (using cpp-4.1_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement cpp-4.1 ...
Preparing to replace g++-4.1 4.1.2-27ubuntu1 (using g++-4.1_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement g++-4.1 ...
Preparing to replace g++-4.1-multilib 4.1.2-27ubuntu1 (using g++-4.1-multilib_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement g++-4.1-multilib ...
Preparing to replace gcc-4.1 4.1.2-27ubuntu1 (using gcc-4.1_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement gcc-4.1 ...
Preparing to replace gcc-4.1-base 4.1.2-27ubuntu1 (using gcc-4.1-base_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement gcc-4.1-base ...
Preparing to replace gcc-4.1-multilib 4.1.2-27ubuntu1 (using gcc-4.1-multilib_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement gcc-4.1-multilib ...
Preparing to replace lib64stdc++6-4.1-dbg 4.1.2-27ubuntu1 (using lib64stdc++6-4.1-dbg_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement lib64stdc++6-4.1-dbg ...
Preparing to replace libstdc++6-4.1-dbg 4.1.2-27ubuntu1 (using libstdc++6-4.1-dbg_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement libstdc++6-4.1-dbg ...
Preparing to replace libstdc++6-4.1-dev 4.1.2-27ubuntu1 (using libstdc++6-4.1-dev_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement libstdc++6-4.1-dev ...
Preparing to replace libstdc++6-4.1-pic 4.1.2-27ubuntu1 (using libstdc++6-4.1-pic_4.1.2-27ubuntu1_i386.deb) ...
Unpacking replacement libstdc++6-4.1-pic ...
dpkg: dependency problems prevent configuration of g++-4.1-multilib:
g++-4.1-multilib depends on lib64stdc++6 (>= 4.1.2-27ubuntu1); however:
Package lib64stdc++6 is not installed.
dpkg: error processing g++-4.1-multilib (--install):
dependency problems - leaving unconfigured
Setting up gcc-4.1-base (4.1.2-27ubuntu1) ...
dpkg: dependency problems prevent configuration of gcc-4.1-multilib:
gcc-4.1-multilib depends on libc6-dev-amd64; however:
Package libc6-dev-amd64 is not installed.
gcc-4.1-multilib depends on lib64gcc1 (>= 1:4.1.2-27ubuntu1); however:
Package lib64gcc1 is not installed.
dpkg: error processing gcc-4.1-multilib (--install):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lib64stdc++6-4.1-dbg:
lib64stdc++6-4.1-dbg depends on lib64stdc++6 (>= 4.1.2-27ubuntu1); however:
Package lib64stdc++6 is not installed.
dpkg: error processing lib64stdc++6-4.1-dbg (--install):
dependency problems - leaving unconfigured
Setting up libstdc++6-4.1-dbg (4.1.2-27ubuntu1) ...
Setting up cpp-4.1 (4.1.2-27ubuntu1) ...
Processing triggers for man-db ...
Setting up gcc-4.1 (4.1.2-27ubuntu1) ...
Setting up libstdc++6-4.1-dev (4.1.2-27ubuntu1) ...
Setting up libstdc++6-4.1-pic (4.1.2-27ubuntu1) ...
Setting up g++-4.1 (4.1.2-27ubuntu1) ...
Errors were encountered while processing:
g++-4.1-multilib
gcc-4.1-multilib
lib64stdc++6-4.1-dbg

how can i do ?

thanks!
 
Old 10-02-2013, 08:40 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 5 .
Quote:
I now change to ubuntu10.10, but I get some message :
.
.
? ? Which command(s) are you doing to get all that text ? ?

Still looks like a 64bits OS ?

And why not use a 32bits Ubuntu 12.04 ?
( Ubuntu 10.10 32bits is good with ns-2.26...2.29,
but `10.10' is unsupported.)

-
 
1 members found this post helpful.
Old 10-02-2013, 10:51 PM   #7
lzw1012
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
# 5 .

? ? Which command(s) are you doing to get all that text ? ?

Still looks like a 64bits OS ?

And why not use a 32bits Ubuntu 12.04 ?
( Ubuntu 10.10 32bits is good with ns-2.26...2.29,
but `10.10' is unsupported.)

-
thanks a lot!
I use command:

sudo dpkg -i *.deb

my os is not 64bit,I will try 32bits Ubuntu 12.04.

when compiling ns2.31 with gcc-4.4 and g++-4.4 ,there have lots of warnings such as:

/common/packet.h:210: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:211: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:212: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:213: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:214: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:215: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:216: warning: deprecated conversion from string constant to ‘char*’

how can I do ??thanks !!
 
Old 10-02-2013, 11:12 PM   #8
lzw1012
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lzw1012 View Post
thanks a lot!
I use command:

sudo dpkg -i *.deb

my os is not 64bit,I will try 32bits Ubuntu 12.04.

when compiling ns2.31 with gcc-4.4 and g++-4.4 ,there have lots of warnings such as:

/common/packet.h:210: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:211: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:212: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:213: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:214: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:215: warning: deprecated conversion from string constant to ‘char*’
./common/packet.h:216: warning: deprecated conversion from string constant to ‘char*’

how can I do ??thanks !!
anyway,which IDE is better chioce when developing ns2.31 with ubuntu 12.04???
thanks !
 
Old 10-02-2013, 11:31 PM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 8 .

Please do not quote your own posts. Delete, please.

IDE : No reason to make things complicated.


Quote:
when compiling ns2.31 with gcc-4.4 and g++-4.4
Also a way of complicating a simple build.
This will do :
tar xvf ns-allinone-2.31 && cd ns-allinone-2.31/
export CC=gcc41 CXX=g++41 && ./install


Warnings are "informative text", not errors.

-
 
Old 10-02-2013, 11:42 PM   #10
lzw1012
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
I have not success to install gcc-4.1 and g++-4.1 on Ubuntu 12.04.
I try as your tips.
 
Old 10-03-2013, 09:51 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 10 .

Sorry, should be : $ sudo dpkg -i gcc41-compat-4.1.2.ubu1204_i386.deb
for the "gcc41-compat" :
https://docs.google.com/file/d/0B7S2...it?usp=sharing

The "g++-compat" : g++41-compat-4.1.2_i386.deb
https://docs.google.com/file/d/0B7S2...it?usp=sharing

-
 
Old 10-04-2013, 04:14 AM   #12
lzw1012
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
I download an install step by step ,but I don't find gcc-4.1

/usr/bin
ls -al |grep gcc*
I get nly gcc-4.6

how I do ???

thank you!
 
Old 10-04-2013, 06:14 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 12 .

How to check an executable : $ which gcc41
... The answer better be : /usr/gcc41/bin/gcc41

A script that sets the PATH is included :
/etc/profile.d/gcc41.sh
... which you will know from the file list :
$ dpkg -L gcc41-compat

-
 
1 members found this post helpful.
Old 10-04-2013, 07:30 AM   #14
lzw1012
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
it's ok !I find it !thank you very much!

I do some steps as :

rm /usr/bin /gcc
ln -s /usr/gcc41/bin/gcc41 /usr/bin/gcc

now I can use gcc-4.1? is it right?

thank you!

Last edited by lzw1012; 10-04-2013 at 08:01 AM.
 
Old 10-04-2013, 08:39 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 14 .

No. You cannot use "gcc-4.1" : There is no file with that name.


Quote:
rm /usr/bin /gcc
ln -s /usr/gcc41/bin/gcc41 /usr/bin/gcc
No reason at all to do that.
All versions of gcc can be used with :
$ export CC=gcc<?> CXX=g++<?> && <other-command>
... Please read post #2 :
$ cd ns-allinone-2.31/ && export CC=gcc41 CXX=g++41 && ./install


What you can do with symlinks is :
$ cd /usr/bin/
$ sudo ln -s ../gcc41/bin/gcc41
$ sudo ln -s ../gcc41/bin/g++41

-

Last edited by knudfl; 10-04-2013 at 08:44 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to install ubuntu12.10 in my laptop!! ravisingh1 Linux - Laptop and Netbook 8 06-05-2013 01:47 PM
can I install gcc 4.3 in ubuntu12.10 on corei3 ? lasyasree Linux - Software 1 03-01-2013 06:22 AM
[SOLVED] not able to install vlc through terminal in ubuntu12.04 ajay06081993 Linux - Newbie 8 11-29-2012 08:37 AM
how to install postgresql8.1.2 in ubuntu12.04 vignesh4sh Ubuntu 5 10-22-2012 12:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration