Game Development Community

MINGW and GCC3

by Andrew Carter · in Torque Game Engine · 09/06/2002 (11:23 am) · 15 replies

I have been successfully compiling Torque using MinGW and GCC2 for awhile. I upgraded to GCC3 and am trying to get this to work. Note that it works find on my Red Hat Linux install using GCC3. I first copied conf.GCC2.WIN32.mk to conf.GCC3.WIN32.mk and removed the -fvtable-thunks option (gcc issued a warning that this is no longer a valid option). Now I get lots of warnings and one fatal error:

--> Compiling platformWin32/winGL.cc
platformWin32/winGL.cc: In function 'void cGLEnableLogging(SimObject*, int,
const char**)':
platformWin32/winGL.cc:5087: invalid conversion from 'const
GLubyte*(*)(unsigned int)' to 'const GLubyte*(*)(unsigned int)'
platformWin32/winGL.cc:5327: invalid conversion from 'void*(*)(int, float,
float, float)' to 'void*(*)(int, float, float, float)'
platformWin32/winGL.cc:5349: invalid conversion from 'void*(*)(int, int)' to '
void*(*)(int, int)'
make[1]: *** [out.GCC3.DEBUG/platformWin32/winGL.obj] Error 1
make: *** [default] Error 2

Anyone have any success with getting this to work? I haven't started digging into the code yet but I was surprised to see it fail when it works fine on GCC3 on Linux. I'd prefer to use the same compiler generation for both my Linux and Win32 builds but I'll drop back to GCC2 in the interim.

Andrew

About the author

Recent Threads


#1
10/04/2002 (4:54 am)
Hmm...

It look like I have the exact same error, but even when using GCC2. Was there anything special you had to do to get it to work under windows?

Regards,
Jonathan
#2
10/04/2002 (8:39 am)
Hmm, it also works for me on my red hat system (gcc 3.2 20020903).

I suspect that this is a problem with certain versions of GCC2 and GCC3, that was fixed at least in the version I'm using. However there may be something we can do about it in the code for those other versions.

I'll look in to it more this weekend. I glanced at it now and noticed some oddities in the declaration of the first function it is complaining about, which is glGetString. The logGetString function has a different format in its definition; not sure if this is what gcc is complaining about but it might be useful to see if conforming it to the dllGetString declaration helps.

./winGL.cc:995:const GLubyte * ( APIENTRY * dllGetString )(GLenum name);
./winGL.cc:2254:static const GLubyte * APIENTRY logGetString(GLenum name)
#3
10/22/2002 (8:40 pm)
John,

Did you had the time to look at it ? I have the exact same problem when doing a DEBUG.

When doing a RELEASE, winGL.cc compile ok but the same problem is with winOpenAL.cc .
#4
10/23/2002 (12:22 pm)
I'm using the latest MinGW version and I get, apart from a huge pile of warnings, the same errors. At least now I know I'm not alone out there.

I flatly refuse to install VC6 again. Real programmers use copy con > program.exe anyway ;)
#5
10/23/2002 (5:28 pm)
Ack, dropped this one. I'll take a look at this soon (*ties string on finger*).

For the warnings, gcc3 has a brand new irritating and non-disableable warning, "invalid offset from non-POD type, use pointer to method instead". I've looked in to this and fixing the "problem" in torque is non trivial.
#6
10/24/2002 (2:19 am)
I ended up downloading GCC 2.95.something and just overwriting GCC3 - make clean, make, and you get a binary. However, the long-term goal should be to make torque compile with GCC3. BTW, the "POD"-warning is just a warning, maybe we can live with that for a while.
#7
10/24/2002 (11:53 am)
Thanks for the info Jeff ! Going to try this tonight. Wouhou !
#8
11/14/2002 (7:19 am)
I checked in the GCC3 MINGW compilation fixes.
#9
11/16/2002 (6:33 pm)
John,

Thanks very much. I will upgrade to 3.2 and try it soon
#10
05/02/2003 (12:38 am)
Hey, I know this thread is like a million years old, but do you guys know what the fix for this error is? I'm getting exactly the same errors as the guy in the original post in this thread.

I just downloaded MinGW, msys, gcc, the Torque SDK, etc. today, so everything should be pretty up to date. I'm using gcc ver 3.2, but compiling with GCC2 because there was no conf.GCC3.WIN32.mk, only a conf.GCC2.WIN32.mk.

Thanks,

Ken
#11
05/02/2003 (2:28 am)
Ken,

John Quigley checked in the file conf.GCC3.WIN32.mk into the HEAD with change # 3061 (see two posts behind yours). A quick diff reviles the below:
diff conf.GCC3.WIN32.mk conf.GCC2.WIN32.mk
27c27
< CFLAGS.GENERAL    = -Wno-conversion -MD -march=i586 -fno-exceptions
---
> CFLAGS.GENERAL    = -Wno-conversion -MD -march=i586 -fvtable-thunks -fno-exceptions

Rich
#12
05/02/2003 (10:46 pm)
Hmm - I tried making that change to GCC3 and it got further that time (I think), and now I'm getting this instead... perhaps I should go back to gcc 2.x - people seem to have fewer problems with that version of the compiler - what do you think?


--> Compiling platformWin32/winOpenAL.cc
platformWin32/winOpenAL.cc: In function 'bool bindFunction(void*&, const 
   char*)':
platformWin32/winOpenAL.cc:39: invalid conversion from 'int (*)()' to 'void*'
make[1]: *** [out.GCC3.RELEASE/platformWin32/winOpenAL.obj] Error 1
make: *** [default] Error 2

I don't know why this is a problem, though: from al/al_func.h:
ALvoid* alGetProcAddress(ALubyte* fname)=...

and from al/altypes.h:
typedef void ALvoid

So why is it thinking that the return type of alGetProcAddress is an int* anyways? Shouldn't it be void* like it wants to be?


Pardon if this is a dumb mistake - I haven't really coded since college...


Thanks,

Ken


update
Dunno why I didn't just try this that night - explicitly casting the return of GetProcAddress to a (void *) fixed it and the rest of the engine compiled just fine.
#13
07/07/2003 (1:18 am)
Hi all,

Got Torque to compile fine using MinGW and MSYS, however I'm having problems with the tools. If I try and compile the tools, I get the following errors:

versions
========
Torque Release_1_1_2
MinGW-2.0.0-3
MSYS-1.0.9-2003.06.30-1

errors
======

$ make
--> Compiling map2dif/exportGeometry.cc
In file included from ../engine/platform/platform.h:14,
from map2dif/editGeometry.h:14,
from map2dif/exportGeometry.cc:10:
../engine/platform/platformAssert.h:34: type specifier omitted for parameter '
U32'
../engine/platform/platformAssert.h:34: parse error before ',' token
../engine/platform/platformAssert.h:44: type specifier omitted for parameter '
U32'
../engine/platform/platformAssert.h:44: parse error before ',' token
In file included from map2dif/editGeometry.h:14,
from map2dif/exportGeometry.cc:10:
../engine/platform/platform.h:136:2: #error "Endian define not set"
In file included from map2dif/editGeometry.h:14,
from map2dif/exportGeometry.cc:10:
../engine/platform/platform.h:215: 'U32' was not declared in this scope
../engine/platform/platform.h:215: parse error before ',' token
../engine/platform/platform.h:222: 'U8' is used as a type, but is not defined
as a type.
../engine/platform/platform.h:223: 'U8' is used as a type, but is not defined
as a type.
../engine/platform/platform.h:224: 'U8' is used as a type, but is not defined
as a type.
../engine/platform/platform.h:225: 'U8' is used as a type, but is not defined
as a type.
../engine/platform/platform.h:226: 'U8' is used as a type, but is not defined
as a type.
../engine/platform/platform.h:227: 'U8' is used as a type, but is not defined
as a type.
../engine/platform/platform.h:228: 'U16' is used as a type, but is not defined
as a type.
../engine/platform/platform.h:229: 'U16' is used as a type, but is not defined
as a type.
../engine/platform/platform.h:238: 'U32' is used as a type, but is not defined
as a type.
../engine/platform/platform.h:240: type specifier omitted for parameter 'S32'
../engine/platform/platform.h:240: parse error before ')' token
../engine/platform/platform.h:241: parse error before '&' token
../engine/platform/platform.h:243: ISO C++ forbids declaration of 'S32' with no
type
../engine/platform/platform.h:243: parse error before '(' token
../engine/platform/platform.h:246: parse error before ')' token
../engine/platform/platform.h:248: 'S32' was not declared in this scope
../engine/platform/platform.h:248: parse error before ')' token
../engine/platform/platform.h:250: ISO C++ forbids declaration of 'U32' with no
type
../engine/platform/platform.h:250: parse error before '(' token
../engine/platform/platform.h:251: ISO C++ forbids declaration of 'U32' with no
type
../engine/platform/platform.h:251: parse error before '(' token
../engine/platform/platform.h:252: ISO C++ forbids declaration of 'U32' with no
type
../engine/platform/platform.h:252: parse error before '(' token
...
...
few pages more
...
...
../engine/platform/platform.h:397: syntax error before 'operator'
../engine/platform/platform.h:398: syntax error before 'operator'
../engine/platform/platform.h:399: syntax error before 'operator'
../engine/platform/platform.h:407: type specifier omitted for parameter '
dsize_t'
../engine/platform/platform.h:407: confused by earlier errors, bailing out
make: *** [out.GCC3.DEBUG/map2dif/exportGeometry.obj] Error 1


Anyone have any ideas that may help?
#14
07/07/2003 (2:42 am)
Sounds like you missed a step in the instrcutions.
#15
07/07/2003 (10:03 am)
Are there MinGW install instructions?