LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   installing older version of gcc and and adding path variables (http://www.linuxquestions.org/questions/linux-desktop-74/installing-older-version-of-gcc-and-and-adding-path-variables-504619/)

jaind 11-24-2006 08:52 PM

installing older version of gcc and and adding path variables
 
Hi

I have come across a simple (but important) problem which is holding up my work.
I would really appreciate if you can help me sort the problem which i describe below:

I am using ubuntu6.10 version with gcc4.1.1 installed. i need to install an older version of gcc (3.1). however after i unistall gcc 4.1.1 and install gcc3.1(from the synaptic package manger) and run "./configure" on a software i have, i am getting the following error:
"configure: error: no acceptable C compiler found in $PATH"

Now i think i know how to add the PATH variable(as i understand i have to cd to /root and add the path in the .bashrc file using export command). however i do not know what path to add. i tried "bin/gcc" among others but it didnt work.

It would be great if you can help me on this.

Thanks for your help!

~jaind

jschiwal 11-25-2006 02:00 PM

Use the ~/.profile or ~/.bash_profile or ~/.bash_login instead. Use the one that exists, if any. The .bashrc script gets run again if you open a shell, so the paths you add will be entered twice. Info bash has details on the startup scripts.

I believe that you could have just installed the 3.1 version and used the -V <version> option. This will use the <machine>-gcc-3.1 compiler.
You could run as root "updatedb" and the use locate to find gcc.

jaind 11-25-2006 03:22 PM

1) so i enter the following in both the .bashrc and the .profile file?
PATH=$PATH:/usr/lib/gcc-lib
export PATH

after this i ran "update .bashrc" and "update .profile"

2) i ran "locate gcc*" and got a huge number of lines some of which are:
-------------------------------------------------------------------
/lib/libgcc_s.so.1
/usr/bin/gcc-3.3
/usr/bin/gccbug-3.3
/usr/bin/gccmakedep
/usr/bin/i486-linux-gnu-gcc-3.3
/usr/lib/gcc
/usr/lib/gcc/i486-linux-gnu
/usr/lib/gcc/i486-linux-gnu/4.1.2
/usr/lib/gcc/i486-linux-gnu/4.1.2/cc1
/usr/lib/gcc/i486-linux-gnu/3.4.6
/usr/lib/gcc/i486-linux-gnu/3.4.6/cc1
/usr/lib/openoffice/program/libcomphelp4gcc3.so
/usr/lib/openoffice/program/libcppuhelpergcc3.so.3
/usr/lib/openoffice/program/libgcc3_uno.so
/usr/lib/openoffice/program/libi18nisolang1gcc3.so
/usr/lib/openoffice/program/libi18nregexpgcc3.so
/usr/lib/openoffice/program/libi18nutilgcc3.so
/usr/lib/openoffice/program/libjvmaccessgcc3.so.3
/usr/lib/openoffice/program/libsalhelpergcc3.so.3
/usr/lib/openoffice/program/libucbhelper3gcc3.so
/usr/lib/openoffice/program/libuno_cppuhelpergcc3.so.3
/usr/lib/openoffice/program/libuno_salhelpergcc3.so.3
/usr/lib/openoffice/program/libvos3gcc3.so
/usr/lib/libgccpp.so.1
/usr/lib/libgccpp.so.1.0.2
/usr/lib/libstlport_gcc.so.4.6
/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/libjavaplugin_nscp_gcc29.so
/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/plugin/i386/ns7-gcc29
/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/plugin/i386/ns7-gcc29/libjavaplugin_oji.so
/usr/lib/gcc-lib
/usr/lib/gcc-lib/i486-linux-gnu
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/iso646.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/README
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/float.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/limits.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/stdarg.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/stdbool.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/stddef.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/syslimits.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/unwind.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/varargs.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/asm
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/asm/posix_types.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/mmintrin.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/emmintrin.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/pmmintrin.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/include/xmmintrin.h
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/cc1
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/collect2
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/specs
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/libgcc.a
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/libgcc_eh.a
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtbegin.o
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtbeginS.o
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtbeginT.o
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtend.o
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtendS.o
/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/libgcc_s.so
/usr/share/doc/gcc-3.3-base
/usr/share/doc/gcc-3.3-base/README.Debian
/usr/share/doc/gcc-3.3-base/TODO.Debian
/usr/share/doc/gcc-3.3-base/changelog.Debian.gz
/usr/share/doc/gcc-3.3-base/changelog.gz
/usr/share/doc/gcc-3.3-base/copyright
/usr/share/doc/gcc-3.3-base/README.Bugs
/usr/share/doc/gcc-3.3-base/gcc
/usr/share/doc/gcc-3.3-base/gcc/changelog.gz
/usr/share/doc/gcc-3.3-base/NEWS.html
/usr/share/doc/gcc-3.3-base/NEWS.gz
/usr/share/doc/gcc-3.3-base/test-summary.gz
/usr/share/doc/gcc-3.3-base/FAQ.gz
/usr/share/doc/gcc-4.1-base
/usr/share/doc/gcc-4.1-base/.changelog.Debian.gz
/usr/share/doc/gcc-4.1-base/.copyright
/usr/share/doc/gcc-4.1-base/README.Debian.gz
/usr/share/doc/gcc-4.1-base/TODO.Debian
/usr/share/doc/gcc-4.1-base/changelog.Debian.gz
/usr/share/doc/gcc-4.1-base/changelog.gz
/usr/share/doc/gcc-4.1-base/copyright
/usr/share/doc/gcc-3.4-base
/usr/share/doc/gcc-3.4-base/README.Debian.gz
/usr/share/doc/gcc-3.4-base/NEWS.Debian.gz
/usr/share/doc/gcc-3.4-base/TODO.Debian
/usr/share/doc/gcc-3.4-base/copyright
/usr/share/doc/gcc-3.4-base/changelog.gz
/usr/share/doc/gcc-3.4-base/changelog.Debian.gz
/usr/share/doc/gcc-3.3
/usr/share/doc/libgcc1
/usr/share/lintian/overrides/libgcc1
/usr/share/locale-langpack/en_GB/LC_MESSAGES/gcc-3.3.mo
/usr/share/locale-langpack/en_GB/LC_MESSAGES/gcc-3.4.mo
/usr/share/locale-langpack/en_GB/LC_MESSAGES/gcc-4.0.mo
/usr/share/man/man1/gccbug-3.3.1.gz
/usr/share/man/man1/gcc-3.3.1.gz
/usr/share/man/man1/gccmakedep.1x.gz
/usr/share/man/man1/i486-linux-gnu-gcc-3.3.1.gz
/usr/share/man/man7/fsf-funding.7gcc.gz
/usr/share/man/man7/gfdl.7gcc.gz
/usr/share/man/man7/gpl.7gcc.gz
/usr/src/linux-headers-2.6.17-10/include/acpi/platform/acgcc.h
/usr/src/linux-headers-2.6.17-10/include/asm-ia64/gcc_intrin.h
/usr/src/linux-headers-2.6.17-10/include/linux/compiler-gcc.h
/usr/src/linux-headers-2.6.17-10/include/linux/compiler-gcc3.h
/usr/src/linux-headers-2.6.17-10/include/linux/compiler-gcc4.h
/usr/src/linux-headers-2.6.17-10/scripts/gcc-version.sh
/usr/src/linux-headers-2.6.17-10-generic/include/linux/compiler-gcc.h
/usr/src/linux-headers-2.6.17-10-generic/include/linux/compiler-gcc3.h
/usr/src/linux-headers-2.6.17-10-generic/include/linux/compiler-gcc4.h
/usr/src/linux-headers-2.6.17-10-generic/scripts/gcc-version.sh
-------------------------------------

--now i cant figure out what is the correct path to add?

--also my system somhow calls gcc as gcc-3.3 as i tried "gcc --version" and got "gcc:command not found". and when i tried "gcc-3.3 --version" i got:
gcc-3.3 (GCC) 3.3.6 (Ubuntu 1:3.3.6-13ubuntu2)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


sorry my questions might be dumb as im new to linux.

Thanks!

jschiwal 11-26-2006 07:18 AM

gcc should be in /usr/bin, so you shouldn't need to update you PATH variable. Also, when you add to your path variable, do it in .profile, and not .bashrc.

The updatedb service runs periodically around 3 am, so if you want the locate command to be current just after installing a program, then run "sudo /usr/bin/updatedb" to update the database manually.

I don't know what you are doing with the "update .bashrc" and "update .profile" commands.

I think that you can reinstall gcc version 4.11. If you use the "-V 3.3" option the /usr/bin/i486-linux-gnu-gcc-3.3 compiler will be used instead. I didn't notice any gcc-3.1 however, but maybe after running updatedb your locate results will be changed.

I'm curious why you need to use version 3.1.


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