Compiling map2dif/main."> Map2dif compile error | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

Map2dif compile error

by Demolishun · in Torque Game Engine · 04/21/2004 (12:37 pm) · 13 replies

Hello,
I am having trouble getting the "tools" to compile under Mandrake Linux 9.1, GCC 3.2.2, and Torque 1.2. Here is the error:

[demolishun@demolishun torque2]$ make tools
Creating library out.GCC3.DEBUG/engine_DEBUG.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:
../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.DEBUG/map2dif/main.obj] Error 1
make: *** [tools] Error 2

About the author

I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67


#1
04/21/2004 (12:37 pm)
Continued from previous:

I have compiled the engine just fine. I do not understand why map2dif would need sound. All I can think is that the compile process is looking for the wrong headers? I have the makefiles configured correctly, I have successfully several times compiled the engine. I even recompiled before I tried compiling the tools.

Any help would be appreciated.
Thanks,
Frank
#2
04/21/2004 (12:59 pm)
Okay, I modified main.cc of map2dif:
#include "sim/frameAllocator.h"
#define NO_OGGVORBIS 1 // I added this to ignore oggbvorbis
#include "gui/guiCanvas.h"

Not I get these errors:
--> Linking map2dif_DEBUG.bin
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXProcessControl.obj)(.text+0x10c): In function 'Cleanup(bool)':
/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXProcessControl.cc:78: undefined reference to 'OpenGLShutdown'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0x559): In function 'ProcessSYSWMEvent':
/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:206: undefined reference to 'NotifySelectionEvent(_XEvent&)'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0x9e0): In function 'Platform::AlertOK(char const*, char const*)':
/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:429: undefined reference to 'XMessageBox::XMessageBox[in-charge](_XDisplay*)'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0x9fc):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:430: undefined reference to 'XMessageBox::alertOK(char const*, char const*)'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xa23):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:432: undefined reference to 'XMessageBox::~XMessageBox [in-charge]()'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xa39):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:432: undefined reference to 'XMessageBox::~XMessageBox [in-charge]()'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xb16): In function 'Platform::AlertOKCancel(char const*, char const*)':
/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:454: undefined reference to 'XMessageBox::XMessageBox[in-charge](_XDisplay*)'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xb32):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:455: undefined reference to 'XMessageBox::alertOKCancel(char const*, char const*)'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xb64):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:459: undefined reference to 'XMessageBox::~XMessageBox [in-charge]()'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xb9a):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:459: undefined reference to 'XMessageBox::~XMessageBox [in-charge]()'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xc80): In function 'Platform::AlertRetry(char const*, char const*)':
/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:482: undefined reference to 'XMessageBox::XMessageBox[in-charge](_XDisplay*)'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xc9c):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:483: undefined reference to 'XMessageBox::alertRetryCancel(char const*, char const*)'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xcce):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:487: undefined reference to 'XMessageBox::~XMessageBox [in-charge]()'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xd04):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:487: undefined reference to 'XMessageBox::~XMessageBox [in-charge]()'
#3
04/21/2004 (1:00 pm)
Split:
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xe02): In function 'Platform::setWindowLocked(bool)':
/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:534: undefined reference to 'typeinfo for UInputManager'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0xe4f):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:539: undefined reference to 'UInputManager::setWindowLocked(bool)'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0x1019): In function 'Platform::process()':
/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:580: undefined reference to 'PollRedbookDevices()'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0x1222): In function 'Platform::init()':
/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:684: undefined reference to 'InstallRedBookDevices()'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0x1233):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:689: undefined reference to 'OpenGLInit'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0x1269):/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:697: undefined reference to 'OpenGLDevice::create()'
../engine/out.GCC3.DEBUG/engine_DEBUG.a(x86UNIXWindow.obj)(.text+0x13af): In function 'Platform::initWindow(Point2I const&, char const*)':
/home/demolishun/torque/torque2/engine/platformX86UNIX/x86UNIXWindow.cc:739: undefined reference to 'InitOpenGL()'
collect2: ld returned 1 exit status
make[1]: *** [map2dif_DEBUG.bin] Error 1
make: *** [tools] Error 2

It looks as though it cannot find the opengl libs somehow. I got that problem solved before for the engine. So now I have no clue?

Thanks,
Frank
#4
04/22/2004 (8:02 am)
I just compiled map2dif using the latest HEAD and had no errors...what version are you trying to compile?

One option is to just remove all of the sound code files from the build of Torque Lib (I did that when I first got this error).
#5
04/22/2004 (4:59 pm)
> I am having trouble getting the "tools" to compile under Mandrake Linux 9.1, GCC 3.2.2, and Torque 1.2. Here is the error:

What do you mean remove the sound code? I put in a constant: #define NO_OGGVORBIS 1. This effectively removed the attempt to compile sound code for the map2dif utility. What I am having trouble with now is undefined references to a whole range of functions, not just sound code.

I tried running the torque debug engine and I noticed strange behavior from the vehicle I had in the level. This vehicle was previously working and I did not understand what was wrong. I finally did a make clean, then a make on the engine. That fixed the vehicle problem. I am wondering if the tools compile messed up the object files by attempting to compile the wrong code for the unix platform? I don't know. I just tried recompiling the tools after recompiling the engine after a make clean. The engine runs fine, but the map2dif still has the above linking errors.

I am going to put a back seat on resolving this. It seems that Matt has been able to compile the map2dif utility under Linux using the HEAD. I am not ready to download the HEAD code just yet. It sounds like this would be the resolution at this time, however. I am using the windows map2dif to create dif files now. I pursued that when I could not get map2dif to compile. I am using Quark for map files under Windows anyway.

There is so much to learn and spending time on an issue with little benefit like this is making me crazy. So a work around to get me going is best. Using the Windows map2dif is a great work around. I tend to get bogged down and lose track of what I really want to do. I want to make cool stuff! BTW, Torque really makes it easy to make cool stuff, despite the learning curve. Once you put a vehicle on the screen it all starts to click. Torque is starting to look less and less like a black box and more like a tool. Yet I am still months away from really understanding its capabilities! It is like the Apple ][ computer used to be. You can learn as little or as much as you want about the system and still use it. I am starting to think about "what" I want to do and less about "how".

Thanks for your help Matt,
Frank
#6
04/23/2004 (4:45 pm)
Frank,

I found I had the same linker issue. I'm running a bit older torque HEAD version here so maybe we've got the same source base here. So this might help you. I didn't try this with the latest HEAD. I didn't have the header file issue. I've ever tried to build the tools in Linux before...

This is what I did to get the linker to work. I basically made LINK.LIBS.TOOLS to look like LINK.LIBS.GENERAL in conf.UNIX.mk. Didn't need to define NO_OGGVORBIS on my setup.

In mk/conf.UNIX.mk (added bold part)
LINK.LIBS.GENERAL = $(LINK.LIBS.VORBIS) -Wl,-static -Wl,-lGLU -Wl,-dy -L/usr/X11R6/lib -lSDL -lpthread -ldl # -lefence

LINK.LIBS.TOOLS   =   [b]$(LINK.LIBS.VORBIS)[/b] -Wl,-static -Wl,-lGLU -Wl,-dy -L/usr/X11R6/lib -lSDL -lpthread -ldl # -lefence

after this change I had to do a 'make clean' to get it to link properly -- like the problem that you had before. I've found that it's always a good idea to do a 'make clean' after any changes to the make files or adding or removing a file from the engine.

make clean
make tools

After this try removing the NO_OGGVORBIS define and let me know how it goes.
#7
04/24/2004 (7:31 am)
Hmmm, I already have that change in the mk/conf.UNIX.mk file. I did not add it, but I just checked the file and it is there. I do have the NO_OGGVORBIS removed now. In another thread someone mentioned somethine about the include files for vorbis stuff:
http://www.garagegames.com/mg/forums/result.thread.php?qt=15831

This helped, but I am still getting a linking error.

Thanks,
Frank
#8
04/24/2004 (11:03 pm)
Okay, here is the latest update on this. I downloaded the Head as of 04-24-2004. I then compiled the using this command:
make clean; make -f mk/configure.mk OS=LINUX COMPILER=GCC3 BUILD=DEBUG; make; make tools

When it finished compiling I got an error in map2dif about some files not being included. This was the fix:
map2dif$(EXT.EXE): CFLAGS += -I../engine -I../lib/zlib -I../lib/lungif -I../lib/lpng -I../lib/ljpeg -I- -I../lib/openal/$(OS)

changed to:
map2dif$(EXT.EXE): CFLAGS += -I../engine -I../lib/zlib -I../lib/lungif -I../lib/lpng -I../lib/ljpeg -I- -I../lib/openal/$(OS) -I../lib/vorbis/include

That took care of the include file issue. However, I am still getting the linker errors as in a previous part of this thread. I do not know what is causing this. All I can think is that it is a linker/compiler issue now. Other Linux users apparently are not suffering from this. I am running a more or less standard Mandrake 9.1 install and cannot think what might be the matter.
#9
04/25/2004 (7:35 am)
Do you get the same issue if you do the below...?

make clean && make tools

The reason I ask is I think when the engine is compiling the shared source files (when you do a 'make') it might be using different CFLAGS which could be causing the linker conflict.
#10
04/26/2004 (7:19 am)
Well my solution was to make dedicated, then make the tools (the dedicated server appears to skip all that OpenGL voodoo.
#11
04/26/2004 (7:21 pm)
Hey, hey, hey!

"make clean && make tools" is a winner! I now have a huge 25M map2dif, but I think compiling as release may help. Now I just compiled it as release and that reduced it to 3M. Now, how do I compile it dedicated. I don't seem to have an option for that.

Thanks,
Frank
#12
04/26/2004 (7:32 pm)
Great news! As far as I know dedicated applies only to the engine for building a dedicated server.

Debug builds are huge due to all the debug symbols stored in there.
#13
04/26/2004 (7:54 pm)
I tried the dedicated and there is no huge size savings over a release build. I am not sure there was any savings. I found out under Unix you have to type "make dedicated" regardless how you setup the config for the make files. I did notice that I had to supply the "dedicated" build this: $(LINK.LIBS.VORBIS) for the lib string. It seems it was missing this and complained about undefined references. I would be nice if the the make files had a way to do a "make depends" for each program.

Now I can compile my tools!

Thanks for everyone's help,
Frank