I am trying to install gcc 4.6 (mainly for having C++0x better supported) in my ubuntu 9.10 (via virtualbox). I referred to previous questions, but I am getting a different error.
I am referring this link for the installation. Now, I have done till the ./gcc-xx/configure ... step. Though it was giving some flex package related error. Mostly due to that make is also failing with below errors:
build/gengtype.o: In function
adjust_field_rtx_def':lexer_line’
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:978:
undefined reference to
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1032:
undefined reference tolexer_line'lexer_line’ ……………
/home/milind/ubuntu_shared/GCC/build/gcc/../../gcc-4.6-20110610/gcc/gengtype.c:1042:
undefined reference to
Now this is giving me a hard time figuring it out because I have already flex/bison latest versions installed. I searched over internet for 2 days almost but no luck. Any help would be really appreciated. Also note that, I already have gcc 4.4 installed in /usr/bin/gcc and I have unzipped the gcc 4.6 tar in my home directory local folder.
[Note: I am also ok with installing ubuntu 11.10 too (which has gcc 4.6) as last resort. But I don’t know if its .iso image is available.]
I got this fixed. I followed following procedure:
[Note: run all the commands with
sudo, if you are not login as root. e.g.sudo ls -ltr; sudo make install;question, download the
gcc4.6...tarfile in a temporary place
gccis stored. e.g. My earliergcc4.4was stored in/usr/lib/gcc/i486-linux-gnu. Whichhas a folder called
4.4,4.4.14.6(or4.6.1/2/3etc.) and put that.tarfile inside it. Untar thefile as shown in link.
link. Use
nohup <command> &totrack the logs. i.e.
nohup makefollowed byclean all &
tail -fnohup.out
package is missing. Mostly those
package will be present in your
current
gccversion. You caninstall them there itself. For
example, in my case
zlibwasmissing. I ran
sudo apt-get installand it workedzlib1g-dev libssl-dev
fine. Otherwise download from internet and install it.
gccis installed, youcan simply check it using
type. In my case it showed thatgcc-4.6
it’s stored as
/usr/local/bin/g++-4.6.compile or you can put an
aliasinyour
bash/tcsh/ksh. e.g./usr/local/bin/g++-4.6 -std=c++0x-Wall test.cpp