-   Linux - Software (
-   -   gcc make error (

laasunde 01-25-2006 07:11 AM

gcc make error

Got fedora core 4 with gcc4 on my system at the moment. Need to install gcc 3.3.6

Have done the following:
# Download gcc-3.3.6.tar.gz to /tmp
# tar -xf gcc-3.3...
# cd gcc-3.3.....
# ./configure prefix=/usr/local (Runs ok)
# make (Get error message below)


f/com.c: At top level:
f/com.c:11080:error: conflicting types for 'ffecom_gfrt_basictype'
f/com.h:236:error:previous declaration of 'ffecom_gfrt_basictype' was here
make[1]: *** [f/com.o] error 1
make[1]: leaving directory '/tmp/gcc-3.3.6/gcc'
make: *** [all-gcc] Error 2

Is there any conflict between my existing gcc4 and the gcc I'm trying to install? How can I fix this problem?

jomen 01-25-2006 08:33 AM

from gcc-install-docs:
"First, we highly recommend that GCC be built into a separate directory than the sources which does not reside within the source tree. This is how we generally build GCC; building where srcdir == objdir should still work, but doesn't get extensive testing; building where objdir is a subdirectory of srcdir is unsupported."
I suggest to read through the relevant sections in the LFS installatin documentation - this is almost ready for cut-and-paste and has worked for me every time

in short:
mkdir ../gcc-build
cd ../gcc-build
../gcc-3.3.6/configure ...and your options here...

maybe you should run "make bootstrap" instead of just "make"

laasunde 01-25-2006 01:09 PM

Thanks for your feedback.

Earlier today I did the following;
# Downloaded gcc-3.3.6.tar to /tmp
# tar -xf gcc-3.3.6.tar
# mkdir /tmp/gcc-build
# cd /tmp/gcc-build
# ../configure --prefix=/usr/local/
# make

Now I get the same error message as above, so I go into gcc-3.3.6/gcc/f and look at com.h and com.c at line 236 and 11080 as stated in the error message. I found that the return parameter in the header file was different than the return type used in the source file. So I change the file and did make again. The process went on for a while then I get this message:


Java/java-tree.h:170: Error: static declaration of 'flag_jni' follows non-static declaration
Java/gjavah.c:49: Error: previous declaration of 'flag_jni' was here

// Java/gjavah.c - line 49
static int flag_jni=0;

// Java/java-tree.h - line 170
extern int flag_jni;

This all seems very strange to me. Am I doing something wrong pre the running the make command? The error look like programming errors which I cannot understand still would be present in a gcc source code. I rather believe Im doing something wrong. Anyway, can anyone help me out. Cheers.

jomen 01-25-2006 01:54 PM

Sorry if this seems strange now and I also might be wrong here, but:
Does'nt Fedora use prebuilt packages like .rpm or even .deb?
As far as I know, you don't usually compile your own programs there (even if you could), you just install prebuilt packages - would'nt that be the easy way?
Again - LFS (rather their excellent handbook on how to do it and why...)would be my reference for this if I had problems. Your error seems to stem from a part or the compiler you will probably never use anyway - from trying to build gjc - you should specify during configure, which compilers you want to build. For c and c++ this would be:

../configure --prefix=/usr/local/ --enable-languages=c,c++

LFS uses quite a few more options and they are explaining exactly why they are being used and not using them can lead to all sorts of problems later on or even during build...
Their recommended options are these:
--enable-clocale=gnu --enable-shared
--enable-threads=posix --enable-__cxa_atexit
--enable-languages=c,c++ --disable-libstdcxx-pch

laasunde 01-25-2006 05:24 PM

Thanks for your input.

One question, by installing gcc via a rpm package would that overwrite my existing gcc 4.0 on the system? (How can I prevent that)

jomen 01-25-2006 06:03 PM

It will probably get installed alongside.
I don't know about how this is handeled on Fedora but typically it is possible to have multiple versions installed - its different between distributions how they handle which one is the "active" compiler - on Gentoo there is a tool gcc-config, which switches compiler-versions - it simply adjusts the paths to binaries and libraries...

eatmetal 02-04-2006 12:34 PM

Older versions of gcc on Fedora 4
The fedora 4 install disk comes with a couple of packages that actually will use older versions of gcc to build things. I've seen on a couple of other sites that GCC version 4 is too strict, so I tried to install gcc 3.3.6 and it wouldn't compile (I think, again, because 4.0.2 is too strict). After some browsing I found this:
( won't let me insert hyperlinks because I don't post here often).

Essentially, installing the packages compat-gcc-32 and compat-gcc-32-c++ will give you the commands gcc32 and g++32. These are gcc version 3.2.3.

I currently have installed:

These are all from the fedora 4 install disks. That seems to resolve some issues with what I'm trying to do.

The thing about these is that they actually use different commands for the old versions of gcc. Using gcc -V 3.2.3 doesn't work. You actually have to type the commands gcc32 or g++32. Try ./configure --help in the directory where you're trying to build something to see how to get the configure script to use a different command.

Good luck!

All times are GMT -5. The time now is 12:55 PM.