Game Development Community

Mingw/gcc

by Frederick Lim · in Torque Game Engine · 01/12/2004 (9:06 pm) · 15 replies

I don't have VC++, can I use MinGW or GCC to compile the source files?

#1
01/12/2004 (9:10 pm)
Of course you can. If you're using Linux try this documentation out: www.garagegames.com/docs/torque.sdk/gstarted/compilers.unix.html

If you're wanting to use MinGW or GCC on Windows then somebody will reply to this forum soon with information on how to do that since I've never really tried to do that before. Sorry. :(
#2
01/13/2004 (10:02 pm)
Just cd your way to the torque directory, and:

Quote:
make -f mk/configure.mk OS=WIN32 BUILD=RELEASE COMPILER=GCC3
make all

That should work, assuming you have MinGW installed correctly. (well, it works for me; I have MinGW installed and MSYS installed).
#3
01/14/2004 (12:30 am)
Thanks for reply, I can build the engine, but I can't build the tools, just pop errors, any ideas?

I am using MinGW and MSYS

$ make tools
Creating library out.GCC3.RELEASE/engine.a
--> Compiling map2dif/main.cc
In file included from ../engine/audio/audioBuffer.h:21,
from ../engine/audio/audioDataBlock.h:13,
from ../engine/gui/guiTypes.h:25,
from ../engine/gui/guiControl.h:25,
from ../engine/gui/guiCanvas.h:16,
from map2dif/main.cc:26:
../engine/audio/vorbisStream.h:26:26: vorbis/codec.h: No such file or directory
In file included from ../engine/audio/audioBuffer.h:21,
from ../engine/audio/audioDataBlock.h:13,
from ../engine/gui/guiTypes.h:25,
from ../engine/gui/guiControl.h:25,
from ../engine/gui/guiCanvas.h:16,
from map2dif/main.cc:26:
#4
01/14/2004 (11:44 am)
Do "make clean" before doing "make tools" in case you had compiled the game itself prior to doing "make tools". If you don't it will fail to build/link properly.
#5
01/14/2004 (9:13 pm)
I run "make all" after "make clean" but still got error while compile the tools. What package I am missing?

In file included from ../engine/audio/audioBuffer.h:19,
from ../engine/audio/audioDataBlock.h:13,
from ../engine/gui/guiTypes.h:25,
from ../engine/gui/guiControl.h:25,
from ../engine/gui/guiCanvas.h:16,
from map2dif/main.cc:26:
../engine/audio/vorbisStream.h:26:26: vorbis/codec.h: No such file or directory
In file included from ../engine/audio/audioBuffer.h:19,
from ../engine/audio/audioDataBlock.h:13,
from ../engine/gui/guiTypes.h:25,
from ../engine/gui/guiControl.h:25,
from ../engine/gui/guiCanvas.h:16,
from map2dif/main.cc:26:
../engine/audio/vorbisStream.h:61: 'ogg_int64_t' is used as a type, but is not
defined as a type.
../engine/audio/vorbisStream.h:62: 'ogg_int64_t' is used as a type, but is not
defined as a type.
../engine/audio/vorbisStream.h:63: 'ogg_sync_state' is used as a type, but is
not defined as a type.
../engine/audio/vorbisStream.h:68: syntax error before '*' token
../engine/audio/vorbisStream.h:69: syntax error before '*' token
../engine/audio/vorbisStream.h:71: syntax error before '*' token
../engine/audio/vorbisStream.h:72: syntax error before '*' token
../engine/audio/vorbisStream.h:73: syntax error before '*' token
../engine/audio/vorbisStream.h:76: 'ogg_int64_t' is used as a type, but is not
defined as a type.
../engine/audio/vorbisStream.h:84: 'ogg_stream_state' is used as a type, but is
not defined as a type.
../engine/audio/vorbisStream.h:86: 'vorbis_dsp_state' is used as a type, but is
not defined as a type.
../engine/audio/vorbisStream.h:87: 'vorbis_block' is used as a type, but is not
defined as a type.
../engine/audio/vorbisStream.h:115: parse error before ')' token
../engine/audio/vorbisStream.h:116: parse error before ')' token
../engine/audio/vorbisStream.h:120: 'ogg_int64_t' was not declared in this
scope
../engine/audio/vorbisStream.h:120: parse error before ')' token
../engine/audio/vorbisStream.h:121: 'ogg_int64_t' was not declared in this
scope
../engine/audio/vorbisStream.h:121: parse error before ')' token
../engine/audio/vorbisStream.h:125: parse error before ')' token
../engine/audio/vorbisStream.h:126: parse error before ')' token
../engine/audio/vorbisStream.h:129: syntax error before '*' token
../engine/audio/vorbisStream.h:130: syntax error before '*' token
../engine/audio/vorbisStream.h:142: 'ogg_page' was not declared in this scope
../engine/audio/vorbisStream.h:142: 'og' was not declared in this scope
../engine/audio/vorbisStream.h:142: parse error before ')' token
../engine/audio/vorbisStream.h:143: 'ogg_page' was not declared in this scope
../engine/audio/vorbisStream.h:143: 'og' was not declared in this scope
../engine/audio/vorbisStream.h:143: invalid data member initialization
../engine/audio/vorbisStream.h:143: (use '=' to initialize static data members)
../engine/audio/vorbisStream.h:145: 'vorbis_info' was not declared in this
scope
../engine/audio/vorbisStream.h:145: 'vi' was not declared in this scope
../engine/audio/vorbisStream.h:145: 'vorbis_comment' was not declared in this
scope
../engine/audio/vorbisStream.h:145: 'vc' was not declared in this scope
../engine/audio/vorbisStream.h:145: parse error before '*' token
../engine/audio/vorbisStream.h:151: type specifier omitted for parameter '
ogg_int64_t'
../engine/audio/vorbisStream.h:151: parse error before ',' token
make[1]: *** [out.GCC3.RELEASE/map2dif/main.obj] Error 1
make: *** [tools] Error 2
#6
01/16/2004 (1:57 pm)
I'm very interested in seeing this work as well...since I'd like to be using the MinGW compiler. I haven't got to the point where I can try it yet tho'... still gathering the pieces.
#7
01/16/2004 (1:59 pm)
../engine/audio/vorbisStream.h:26:26: vorbis/codec.h: No such file or directory

Looks to me like an include path problem... you might take a quick look at the Makefile in the map2dif directory to see if it makes sense.

Just a guess...
#8
01/16/2004 (2:24 pm)
You need to modiffy the mk/conf.GCC3.WIN32 make file to add the vorbis libs

LINK.LIBS.VORBIS  = ../lib/vorbis/win32/libogg.a ../lib/vorbis/win32/libvorbis.a ../lib/vorbis/win32/libogg.a
LINK.LIBS.GENERAL = -lmingw32 -lcomdlg32 -luser32 -ladvapi32 -lgdi32 -lwinmm -lwsock32 -lvfw32 $(LINK.LIBS.VORBIS)
LINK.LIBS.TOOLS   = -lmingw32 -lcomdlg32 -luser32 -ladvapi32 -lgdi32 -lwinmm -lwsock32 -lvfw32 $(LINK.LIBS.VORBIS)

and in engine/targets.torque.mk look for the include section and it should be similar to the following

#---------------------------------------
# Set up include variables here.
INCLUDES_BASE = -I../lib/zlib -I../lib/lungif -I../lib/lpng -I../lib/ljpeg -I../lib/directx8 -I../lib/vorbis/include
INCLUDES_LINUX = $(INCLUDES_BASE) -I../lib/openal/LINUX
INCLUDES_OpenBSD = $(INCLUDES_BASE) -I../lib/openal/OpenBSD
INCLUDES_FreeBSD = $(INCLUDES_BASE) -I../lib/openal/FreeBSD
INCLUDES_WIN32 = $(INCLUDES_BASE) -I../lib/openal/win32
#9
01/16/2004 (7:26 pm)
After change the con.GCC32.WIN32 file, still got some error...

Creating library out.GCC3.RELEASE/engine.a
--> Compiling map2dif/main.cc
In file included from ../engine/audio/audioBuffer.h:19,
from ../engine/audio/audioDataBlock.h:13,
from ../engine/gui/guiTypes.h:25,
from ../engine/gui/guiControl.h:25,
from ../engine/gui/guiCanvas.h:16,
from map2dif/main.cc:26:
../engine/audio/vorbisStream.h:26:26: vorbis/codec.h: No such file or directory
In file included from ../engine/audio/audioBuffer.h:19,
from ../engine/audio/audioDataBlock.h:13,
from ../engine/gui/guiTypes.h:25,
from ../engine/gui/guiControl.h:25,
from ../engine/gui/guiCanvas.h:16,
from map2dif/main.cc:26:
../engine/audio/vorbisStream.h:61: 'ogg_int64_t' is used as a type, but is not
defined as a type.
../engine/audio/vorbisStream.h:62: 'ogg_int64_t' is used as a type, but is not
defined as a type.
../engine/audio/vorbisStream.h:63: 'ogg_sync_state' is used as a type, but is
not defined as a type.
../engine/audio/vorbisStream.h:68: syntax error before '*' token
../engine/audio/vorbisStream.h:69: syntax error before '*' token
../engine/audio/vorbisStream.h:71: syntax error before '*' token
../engine/audio/vorbisStream.h:72: syntax error before '*' token
../engine/audio/vorbisStream.h:73: syntax error before '*' token
../engine/audio/vorbisStream.h:76: 'ogg_int64_t' is used as a type, but is not
defined as a type.
../engine/audio/vorbisStream.h:84: 'ogg_stream_state' is used as a type, but is
not defined as a type.
../engine/audio/vorbisStream.h:86: 'vorbis_dsp_state' is used as a type, but is
not defined as a type.
../engine/audio/vorbisStream.h:87: 'vorbis_block' is used as a type, but is not
defined as a type.
../engine/audio/vorbisStream.h:115: parse error before ')' token
../engine/audio/vorbisStream.h:116: parse error before ')' token
../engine/audio/vorbisStream.h:120: 'ogg_int64_t' was not declared in this
scope
../engine/audio/vorbisStream.h:120: parse error before ')' token
../engine/audio/vorbisStream.h:121: 'ogg_int64_t' was not declared in this
scope
../engine/audio/vorbisStream.h:121: parse error before ')' token
../engine/audio/vorbisStream.h:125: parse error before ')' token
../engine/audio/vorbisStream.h:126: parse error before ')' token
../engine/audio/vorbisStream.h:129: syntax error before '*' token
../engine/audio/vorbisStream.h:130: syntax error before '*' token
../engine/audio/vorbisStream.h:142: 'ogg_page' was not declared in this scope
../engine/audio/vorbisStream.h:142: 'og' was not declared in this scope
../engine/audio/vorbisStream.h:142: parse error before ')' token
../engine/audio/vorbisStream.h:143: 'ogg_page' was not declared in this scope
../engine/audio/vorbisStream.h:143: 'og' was not declared in this scope
../engine/audio/vorbisStream.h:143: invalid data member initialization
../engine/audio/vorbisStream.h:143: (use '=' to initialize static data members)
../engine/audio/vorbisStream.h:145: 'vorbis_info' was not declared in this
scope
../engine/audio/vorbisStream.h:145: 'vi' was not declared in this scope
../engine/audio/vorbisStream.h:145: 'vorbis_comment' was not declared in this
scope
../engine/audio/vorbisStream.h:145: 'vc' was not declared in this scope
../engine/audio/vorbisStream.h:145: parse error before '*' token
../engine/audio/vorbisStream.h:151: type specifier omitted for parameter '
ogg_int64_t'
../engine/audio/vorbisStream.h:151: parse error before ',' token
make[1]: *** [out.GCC3.RELEASE/map2dif/main.obj] Error 1
make: *** [tools] Error 2
#10
01/20/2004 (6:20 am)
What about the changes to engine/targets.torque.mk? did you make those as well??

-Ron
#11
01/22/2004 (6:51 am)
Yes I checked the engine/targets.torque.mk is OK.
#12
01/22/2004 (7:08 am)
Quote:
../engine/audio/vorbisStream.h:26:26: vorbis/codec.h: No such file or directory

looks like it can not find the header files in the vorbis dir. This is set in the targets.torque.mk file as listed above.

Check your lib dir to see if you have a vorbis dir and its associated sub dirs.

RYackett@4Q9BX31 /c/torque/lib/vorbis
$ ls -l
total 0
drwxr-xr-x    5 RYackett Administ        0 Jan 13 11:33 include
drwxr-xr-x    3 RYackett Administ        0 Jan 13 11:33 linux
drwxr-xr-x    3 RYackett Administ        0 Jan 13 11:34 macosx
drwxr-xr-x    3 RYackett Administ        0 Jan 13 11:34 win32

-Ron
#13
01/22/2004 (8:24 pm)
I found the codec.h is in /c/torque/lib/vorbis/include/vorbis directory.

Frederick Lim@ATHLON /c/torque/lib/vorbis/include/vorbis
$ ls -l
total 8
drwxr-xr-x 2 Frederic Administ 0 Jan 20 11:38 CVS
-r--r--r-- 1 Frederic Administ 7937 Sep 26 05:10 codec.h
-r--r--r-- 1 Frederic Administ 2675 Sep 26 05:10 vorbisenc.h
-r--r--r-- 1 Frederic Administ 5079 Sep 26 05:10 vorbisfile.h
#14
01/29/2004 (12:32 pm)
The problem is with tools/targets.map2dif.mk -- it has it's own set of CFLAGS which don't include "-I../lib/vorbis/include". The file engine/targets.torque.mk is already the same as you posted above. The file mk/conf.GCC3.WIN32.mk is missing the "$(LINK.LIBS.VORBIS)" on the "LINK.LIBS.TOOLS" line. After the above two issues are fixed, "make all" was successful with MinGW32. :-)

This is for the CVS "Release_1_2_0" build.
#15
02/02/2004 (9:35 pm)
I can compile the Release 1.2 engine and tools! Thank you :)

I try HEAD today and found the same problem, will this problem fix in next update? This help newcomer like me no need to spend so much time in compiling the engine.