Opened 16 years ago

Closed 16 years ago

Last modified 2 months ago

#1180 closed defect (fixed)

Sword2 engine won't compile with older g++

Reported by: SF/aiviru Owned by: fingolfin
Priority: normal Component: Engine: Sword2
Keywords: Cc:
Game: Broken Sword 2

Description

Main reason I'm reporting this is that unless you massage some files by hand, this is pretty critical combined with bug #793762. If fixing that is deemed sufficient to fix breakage, by all means feel free to ignore this report ;)

When using at least g++ 2.95.4 to compile scummvm, the sword2 engine will not want to build. This problem doesn't occur in at least g++ 3.0.4. As per scummvm-20030823.tar.bz2 (but also earlier versions) the error is:

g++ -Wp,-MMD,"bs2/.deps/anims.d2" -O -Wall -Wuninitialized -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -g -pedantic -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor -Wno-reorder -Wwrite-strings -fcheck-new -Wctor-dtor-privacy -DHAVE_CONFIG_H -DUNIX -I. -Icommon -I/usr/include/SDL -D_REENTRANT -c bs2/anims.cpp -o bs2/anims.o In file included from bs2/anims.cpp:32: bs2/driver/driver96.h:1271: invalid use of undefined type `class Surface' bs2/driver/driver96.h:1252: forward declaration of `class Surface' bs2/driver/driver96.h:1271: `s' was not declared in this scope bs2/driver/driver96.h:1271: parse error before `*' bs2/driver/driver96.h:1272: invalid use of undefined type `class Surface' bs2/driver/driver96.h:1252: forward declaration of `class Surface' bs2/driver/driver96.h:1272: `s' was not declared in this scope bs2/driver/driver96.h:1272: parse error before `*' bs2/driver/driver96.h:1272: `Surface::blit(...)' has already been declared in `Surface' make: *** [bs2/anims.o] Error 1

Sys info: [aiviru@blight ~/src/scummvm]$ uname -a Linux blight 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i686 unknown [aiviru@blight ~/src/scummvm]$ g++ -v Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs gcc version 2.95.4 20011002 (Debian prerelease)

And a g++ that DOES work:[aiviru@blight ~/src/scummvm]$ g++-3.0 -v Reading specs from /usr/lib/gcc-lib/i386-linux/3.0.4/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux Thread model: posix gcc version 3.0.4

Ticket imported from: #793767. Ticket imported from: bugs/1180.

Change History (10)

comment:1 by fingolfin, 16 years ago

BS2 is not a supported engine. If it doesn#t compile for you at this point, just disable it.

In any case, this looks like a compiler bug. Note that the last official release of GCC 2.x was 2.95.3; hence you "2.95.4" must be some kind of prerelease. We can not gurantee compatibility with such software, sorry.

comment:2 by fingolfin, 16 years ago

Owner: set to fingolfin
Resolution: wontfix
Status: newclosed

comment:3 by SF/khalek, 16 years ago

Status: closednew

comment:4 by SF/khalek, 16 years ago

2.95.4 is the default 2.95 version in debian I think you'll find that this happens with all versions of 2.95.x

opening as this should not have been closed

comment:5 by fingolfin, 16 years ago

Status: newclosed

comment:6 by fingolfin, 16 years ago

Resolution: wontfixfixed

comment:7 by fingolfin, 16 years ago

Indeed, seems this bug affects GCC 2.95.2, too. It's clearly a compiler bug. Oh and 2.95.4 still is a prerelease build, and not an official GCC release, even if debian ships it... :-)

I put a work around for this compiler bug into CVS - however, I don't think we should spend too much effort on supporting clearly bugged compilers, esp. if better alternatives are easily available (like GCC 3.2 and newer. Don't use 3.0.4, it's bad, too :-)

comment:8 by SF/khalek, 16 years ago

There are quite a few systems that ship with only 2.95.x for several reasons.

I never said 2.95.4 was not a prerelease version :) As debian runs on something like 11 archs I imagine .4 contains some needed fixes.

Clearly GCC 3. is desirable for C++ code, but I think we should still support 2.95 for a while yet.

comment:9 by digitall, 13 months ago

Component: --Unset--Engine: Sword2

comment:10 by Thunderforge, 2 months ago

Game: Broken Sword 2
Note: See TracTickets for help on using tickets.