Game Development Community

GCC 3.4.1 bugs

by James Urquhart · in Torque Game Engine · 09/18/2004 (4:31 am) · 70 replies

Hi there,

I've recently reinstalled my gentoo linux system.

Unfortunatly, it seems that i have been updated to a newer GCC release. I am getting rather odd compiler errors in torque (relatively recent HEAD copy).

Firstly, it seems "-mcpu" is deprecated, so i'm getting the nice warning when compiling each source file :
Quote:
--> Compiling lpng/png.c
'-mcpu=' is deprecated. Use '-mtune=' or '-march=' instead.
--> Compiling lpng/pngerror.c
'-mcpu=' is deprecated. Use '-mtune=' or '-march=' instead.
...

Secondly, in core/resManager.h :
Quote:
--> Compiling audio/audio.cc
'-mcpu=' is deprecated. Use '-mtune=' or '-march=' instead.
In file included from ./audio/audioBuffer.h:16,
from ./audio/audioDataBlock.h:13,
from ./audio/audio.h:13,
from audio/audio.cc:6:
./core/resManager.h: In member function 'void Resource<T>::unlock()':
./core/resManager.h:255: error: invalid use of undefined type 'struct ResManager'
./core/resManager.h:38: error: forward declaration of 'struct ResManager'
...
(errors also exist in the subsequent inline's that use ResourceManager)

Seems it does not like using the forward declaration (class ResManager;) and the subsequent "extern ResManager *ResourceManager;" object, though i don't see why this should be a problem. It even thinks ResManager is a struct, which it clearly is not.
Perhaps could be a new GCC bug?

And in platform/event.h :
Quote:
In file included from ./sim/netConnection.h:19,
from ./game/gameConnection.h:16,
from audio/audio.cc:11:
./platform/event.h: At global scope:
./platform/event.h:137: error: a casts to a type other than an integral or enumeration type cannot appear in a constant-expression
./platform/event.h:137: error: '->' cannot appear in a constant-expression
./platform/event.h:137: error: '&' cannot appear in a constant-expression
./platform/event.h:137: error: enumerator value for 'PacketReceiveEventHeaderSize' not integer constant
./platform/event.h:140: error: a casts to a type other than an integral or enumeration type cannot appear in a constant-expression
./platform/event.h:140: error: '->' cannot appear in a constant-expression
./platform/event.h:140: error: '&' cannot appear in a constant-expression
./platform/event.h:140: error: enumerator value for 'ConnectedReceiveEventHeaderSize' not integer constant
...

It seems to be having a problem with the Offset() macro.

My GCC version is as follows :
Quote:
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.1/specs
Configured with: /var/tmp/portage/gcc-3.4.1-r2/work/gcc-3.4.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4/info --enable-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++ --enable-threads=posix --enable-long-long --disable-checking --disable-libunwind-exceptions --enable-cstdio=stdio --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.1/include/g++-v3 --with-local-prefix=/usr/local --disable-werror --enable-shared --enable-nls --without-included-gettext --disable-multilib --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.4.1 20040803 (Gentoo Linux 3.4.1-r2, ssp-3.4-2, pie-8.7.6.5)

I'll see if i can fix these errors. If anyone has any bright ideas, please tell me
Page«First 1 2 3 4 Next»
#61
05/12/2005 (6:58 pm)
I figured it out. this message is make's way of saying it can't find a file. The gui folders have been rearanged, but the targets.torque.mk file wasn't updated. i changed it but i am getting compile errors. will work on it more.
#62
05/31/2005 (8:56 am)
What the status on this?
#63
05/31/2005 (9:47 am)
The "offsetof" problem seems to be (mostly) resolved in the current HEAD version. There's one or two places where there are still "rogue" definitions of the macro that need to be removed tho'. The rearranging of the lines in resource.h hadn't been done the last time I checked.
#64
07/14/2005 (3:21 pm)
The conditionals testing for GCC >= 3.4 don't work right for GCC 4. They only look for major version == 3, and minor >= 4.
#65
09/30/2005 (4:51 am)
Almost All erros that I got in TGE 1.3 compiling with MinGW and MSYS on Windows was solved by this thread. Thx :)
#66
10/09/2005 (12:22 am)
I'm a complete noob. I just got the TGE 1.3 SDKtoday and I have the problems stated here. Are the fixes in the SDK or do I have to grab the source code from CVS?
#67
10/12/2005 (4:34 am)
Personally, I'd grab the latest from CVS.

Ain't no sense in reinventing the wheel.
#68
10/12/2005 (6:20 am)
Unfortunately, you have to work out the compiler issues by hand... they have never released a set of fixes which solves all the problems (even though it's been over a year now since the 1.3 release) although the latest CVS version before 1.4RC1 is probably the closest to a working version (but still has a few issues).

The latest CVS (1.4RC2 + more recent fixes) might be okay on Windows (I haven't tried it yet tho'), but don't bother trying to get it working on Linux unless you enjoy pain... ;-)
#69
10/14/2005 (2:20 pm)
The lighting pack source has the exact same issue.
I'm using the latest lighting pack. What are the odds that I can swap only the source files in question in CVS head for those that came with it? Rather slim I imagine... I'm not much of a programmer.

The latest Mac OS seems to stop compiling on the same file but I don't know about the circumstances.
#70
10/16/2005 (9:34 pm)
For the MacOS build... configure the Xcode project to use gcc-3.3 by setting "GCC_VERSION" to "gcc-3.3" in the project settings. Then it will build up until the final link step... and you'll get an error about libogg.a and libvorbis.a. Open a terminal window... cd into lib/vorbis/macosx (check the path - I'm not exactly sure) and run "ranlib libogg.a" and "ranlib libvorbis.a". Then click Build in Xcode and it should link successfully.

I'm not sure why we can't just use the "UNIX" makefiles for building on Mac... like it works on Linux, MinGW, etc... but I guess that's not a priority for GG.

For the Linux build, probably the way to go is to use the last 1.3.X version in CVS - I don't recall what the exact tag is, but BG created the tag just before starting with the 1.4 stuff in CVS. Or, you can use gcc 3.3.X and build TGE 1.3 successfully on Linux. Unfortunately, you might have to build gcc 3.3.X from source if your Linux dist doesn't have it available - I use Mandrake (Mandriva), and they've been including 3.4.X for several versions now (before TGE 1.3 was released)... so TGE 1.3 was pretty much guaranteed to not compile "out of the box" on any Linux dist that was using gcc 3.4.X. ;-)

The good news is that the Linux and MinGW builds both use the "UNIX" Makefiles so once you get one working, you'll have easily have the other.
Page«First 1 2 3 4 Next»