Author Topic: Hello! Q-Gears is really hard to compile  (Read 5618 times)

Googly

  • Guest
Hello! Q-Gears is really hard to compile
« on: 2007-02-08 04:48:13 »
Hello, I have been watching from the shadows for years, you might not know me but I know you!

Sorry if this is the wrong place to ask this, I read all the important read this first messages, and sourceforge's bug submitting feature scared me off.

Sorry if I ask any totally noobish type stuff about compiling, I have a hard time getting my own code to compile  :roll:

I downloaded the source code and tried to compile it, but to no avail!

I understand that the sourcecode is quite hectic and dynamic right now so a failed compile was understandable

I managed to bypass some errors by haxoring makefiles and stuff like so:
Code: [Select]
./bootstrap
configure.ac:30: error: AC_PROG_CC cannot be called after AM_PROG_CC_C_O

success after commenting out "AM_PROG_CC_C_O"

./configure
configure: error: ODE is required

success after commenting out "QGEARS_CHECK_ODE([], [AC_MSG_ERROR([ODE is required])])"
from configure.ac

make
display/../TypeDefine.h:29: error: conflicting declaration 'typedef long unsigned int uint32_t'
/usr/include/stdint.h:52: error: 'uint32_t' has a previous declaration as 'typedef unsigned int uint32_t'
display/../TypeDefine.h:33: error: conflicting declaration 'typedef long int int32_t'
/usr/include/sys/types.h:197: error: 'int32_t' has a previous declaration as 'typedef int int32_t'

success after changing TypeDefine.h:16 from #ifndef HAVE_INTTYPES_H to #ifdef HAVE_INTTYPES_H

make[3]: *** No rule to make target `module/Module.cpp', needed by `module/libcommon_la-Module.lo'.  Stop.
make[3]: *** No rule to make target `field/UnitManager.cpp', needed by `field/q_gears_ffvii-UnitManager.o'.  Stop.
make[3]: *** No rule to make target `field/script/Entity.cpp', needed by `field/script/q_gears_ffvii-Entity.o'.  Stop.
make[3]: *** No rule to make target `field/script/Script.cpp', needed by `field/script/q_gears_ffvii-Script.o'.  Stop.
make[3]: *** No rule to make target `field/script/ScriptManager.cpp', needed by `field/script/q_gears_ffvii-ScriptManager.o'.  Stop.

create empty dummy files -> success

g++ -DHAVE_CONFIG_H -I. -I../..  -I ../../src -I ../../src -I/usr/include/libxml2   @[email protected]   -g -O2 -Wall -W -fpermissive -pipe -MT field/q_gears_ffvii-Math.o -MD -MP -MF field/.deps/q_gears_ffvii-Math.Tpo -c -o field/q_gears_ffvii-Math.o `test -f 'field/Math.cpp' || echo './'`field/Math.cpp
g++: @[email protected]: No such file or directory

success after removing @[email protected] and @[email protected] from src/ffvii/Makefile.am

But after all that I get an endless stream of undefined references (my worst nightmare) like so (excerpt):  :-o
Code: [Select]
...
[screentest/GuiTest.cpp:272: undefined reference to `DataBase::GetSizeOfArmorDescriptions() const'
screentest/GuiTest.cpp:355: undefined reference to `DATABASE'
screentest/GuiTest.cpp:355: undefined reference to `DataBase::GetSizeOfItemNames() const'
screentest/GuiTest.cpp:361: undefined reference to `DATABASE'
screentest/GuiTest.cpp:361: undefined reference to `DataBase::GetItemName(int) const'
screentest/GuiTest.cpp:356: undefined reference to `DATABASE'
screentest/GuiTest.cpp:356: undefined reference to `DataBase::GetSizeOfItemNames() const'
screentest/GuiTest.cpp:327: undefined reference to `DATABASE'
screentest/GuiTest.cpp:327: undefined reference to `DataBase::GetSizeOfCommandNames() const'
screentest/GuiTest.cpp:333: undefined reference to `DATABASE'
screentest/GuiTest.cpp:333: undefined reference to `DataBase::GetCommandName(int) const'
screentest/GuiTest.cpp:328: undefined reference to `DATABASE'
screentest/GuiTest.cpp:328: undefined reference to `DataBase::GetSizeOfCommandNames() const'
screentest/GuiTest.cpp:411: undefined reference to `DATABASE'
screentest/GuiTest.cpp:411: undefined reference to `DataBase::GetSizeOfMateriaNames() const'
screentest/GuiTest.cpp:417: undefined reference to `DATABASE'
screentest/GuiTest.cpp:417: undefined reference to `DataBase::GetMateriaName(int) const'
screentest/GuiTest.cpp:412: undefined reference to `DATABASE'
screentest/GuiTest.cpp:412: undefined reference to `DataBase::GetSizeOfMateriaNames() const'
screentest/GuiTest.cpp:383: undefined reference to `DATABASE'
screentest/GuiTest.cpp:383: undefined reference to `DataBase::GetSizeOfArmorNames() const'
screentest/GuiTest.cpp:389: undefined reference to `DATABASE'
screentest/GuiTest.cpp:389: undefined reference to `DataBase::GetArmorName(int) const'
screentest/GuiTest.cpp:384: undefined reference to `DATABASE'
screentest/GuiTest.cpp:384: undefined reference to `DataBase::GetSizeOfArmorNames() const'
screentest/GuiTest.cpp:439: undefined reference to `DATABASE'
screentest/GuiTest.cpp:439: undefined reference to `DataBase::GetSizeOfBattleTexts() const'
screentest/GuiTest.cpp:445: undefined reference to `DATABASE'
screentest/GuiTest.cpp:445: undefined reference to `DataBase::GetBattleText(int) const'
screentest/GuiTest.cpp:440: undefined reference to `DATABASE'
screentest/GuiTest.cpp:440: undefined reference to `DataBase::GetSizeOfBattleTexts() const'
screentest/q_gears_ffvii-GuiTest.o: In function `~GuiTest':
screentest/GuiTest.cpp:22: undefined reference to `Actor::~Actor()'
screentest/GuiTest.cpp:22: undefined reference to `Actor::~Actor()'
screentest/q_gears_ffvii-GuiTest.o:(.rodata._ZTI7GuiTest[typeinfo for GuiTest]+0x8): undefined reference to `typeinfo for Actor'
worldmap/q_gears_ffvii-WorldMapModule.o: In function `~WorldMapModule':
worldmap/WorldMapModule.cpp:27: undefined reference to `Actor::~Actor()'
worldmap/WorldMapModule.cpp:27: undefined reference to `Actor::~Actor()'
worldmap/WorldMapModule.cpp:27: undefined reference to `Actor::~Actor()'
worldmap/WorldMapModule.cpp:27: undefined reference to `Actor::~Actor()'
worldmap/q_gears_ffvii-WorldMapModule.o: In function `WorldMapModule':
worldmap/WorldMapModule.cpp:18: undefined reference to `Actor::Actor()'
worldmap/WorldMapModule.cpp:21: undefined reference to `Actor::~Actor()'
worldmap/WorldMapModule.cpp:18: undefined reference to `Actor::Actor()'
worldmap/WorldMapModule.cpp:21: undefined reference to `Actor::~Actor()'
worldmap/q_gears_ffvii-WorldMapModule.o: In function `~WorldMapModule':
worldmap/WorldMapModule.cpp:27: undefined reference to `Actor::~Actor()'
worldmap/WorldMapModule.cpp:27: undefined reference to `Actor::~Actor()'
worldmap/q_gears_ffvii-WorldMapModule.o:(.rodata._ZTI14WorldMapModule[typeinfo for WorldMapModule]+0x8): undefined reference to `typeinfo for Actor'
battle/q_gears_ffvii-BattleModule.o: In function `~BattleModule':
battle/BattleModule.cpp:24: undefined reference to `Actor::~Actor()'
battle/q_gears_ffvii-BattleModule.o: In function `BattleModule':
battle/BattleModule.cpp:15: undefined reference to `Actor::Actor()'
battle/BattleModule.cpp:15: undefined reference to `Actor::Actor()'
battle/q_gears_ffvii-BattleModule.o: In function `~BattleModule':
battle/BattleModule.cpp:24: undefined reference to `Actor::~Actor()'
battle/BattleModule.cpp:24: undefined reference to `Actor::~Actor()'
...

My automake and autoconf are of the required versions!

thanks for reading!

simcop2387

  • Guest
Re: Hello! Q-Gears is really hard to compile
« Reply #1 on: 2007-02-08 05:45:48 »
do not comment out the check for ODE in configure, i'm guessing, and go install ODE to compile it.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Hello! Q-Gears is really hard to compile
« Reply #2 on: 2007-02-08 06:24:05 »
I was under the assumption that the ODE dependency was removed in 0.11.

Akari, want to verify?
 

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Hello! Q-Gears is really hard to compile
« Reply #3 on: 2007-02-08 07:34:27 »
I was under the assumption that the ODE dependency was removed in 0.11.

Akari, want to verify?
 

Of course it was removed. BUT! is anyone update automake? I only work with Dev-C++ and I removed it from devcpp project.

G

  • *
  • Posts: 104
  • , kupo.
    • View Profile
Re: Hello! Q-Gears is really hard to compile
« Reply #4 on: 2007-02-08 15:30:02 »
Quote
./bootstrap
configure.ac:30: error: AC_PROG_CC cannot be called after AM_PROG_CC_C_O
It was fixed earlier. In SVN macros AM_PROG_CC_C_O is after AC_PROG_CC. Use SVN source.

Googly

  • Guest
Re: Hello! Q-Gears is really hard to compile
« Reply #5 on: 2007-02-08 16:25:05 »
Thanks for all the replies!
I was using the SVN source (newest revision 136) .
I will post when I figure out a solution; though I really hate linker errors with a passion.

It was fixed earlier. In SVN macros AM_PROG_CC_C_O is after AC_PROG_CC. Use SVN source.

Here is an excerpt from http://q-gears.svn.sourceforge.net/viewvc/q-gears/trunk/configure.ac?view=markup
Code: [Select]
   24 AM_PROG_CC_C_O
   25
   26 ## -------------------------------------
   27 ## Development tools
   28
   29 # Look for a C compiler.
   30 AC_PROG_CC

Unless there's something I'm missing (likely, since I have no Idea how autoconf and friends work) AM_PROG_CC_C_O is indeed before AC_PROG_CC.

Thanks for all your help.
« Last Edit: 2007-02-08 16:31:47 by Googly »

G

  • *
  • Posts: 104
  • , kupo.
    • View Profile
Re: Hello! Q-Gears is really hard to compile
« Reply #6 on: 2007-02-08 17:24:17 »
Checked SVN source. Someone replaced configure.ac with older version. I will fix it today.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Hello! Q-Gears is really hard to compile
« Reply #7 on: 2007-02-08 22:09:29 »
That would be me, sorry. Akari had an older version that he sent me for the .011 mass update. Because it was different than the current version on SVN, it was "updated"

Sorry, I should of looked for regressions. I'd do that next time around ^_^

Speaking of SVN, is it working OK for everyone?

Googly

  • Guest
Re: Hello! Q-Gears is really hard to compile
« Reply #8 on: 2007-02-10 19:49:28 »
Hello again!

I have gotten q-gears to compile (but not the xeno subfolder), it seems to me the Linux makefiles are out of date...

Here's all my .patch files if anyone is interested:

Code: [Select]
--- ./src/common/Makefile.am
+++ ./src/common/Makefile.am
@@ -12,6 +12,7 @@
 libcommon_la_SOURCES = \
  \
  display/3dTypes.h \
+ display/actor/Actor.h display/actor/Actor.cpp \
  display/DisplayOgl.h display/DisplayOgl.cpp \
  display/Display.h display/Display.cpp \
  display/MatrixStack.h display/MatrixStack.cpp \
@@ -41,7 +42,6 @@
    input/handlers/InputHandler.h input/handlers/InputHandler.cpp \
    input/handlers/InputHandlerSdl.h input/handlers/InputHandlerSdl.cpp \
  \
- module/Module.h module/Module.cpp \
  module/ModuleManager.h module/ModuleManager.cpp \
  module/Splash.h module/Splash.cpp \
  \
--- ./configure.ac
+++ ./configure.ac
@@ -21,13 +21,12 @@
 # Initialize automake.
 AM_INIT_AUTOMAKE([1.9.6 foreign subdir-objects dist-bzip2])
 
-AM_PROG_CC_C_O
-
 ## -------------------------------------
 ## Development tools
 
 # Look for a C compiler.
 AC_PROG_CC
+AM_PROG_CC_C_O
 
 # Look for a C++ compiler
 AC_PROG_CXX
@@ -57,9 +56,6 @@
 # Ask for SDL
 QGEARS_CHECK_SDL([1.2.8], [], [AC_MSG_ERROR([SDL is required])])
 
-# Ask for libode
-QGEARS_CHECK_ODE([], [AC_MSG_ERROR([ODE is required])])
-
 # Check linux CD XA driver relevance
 QGEARS_CHECK_LINUX_CDXA_DRIVER
 
--- ./src/ffvii/Makefile.am
+++ ./src/ffvii/Makefile.am
@@ -1,7 +1,7 @@
 ##
 bin_PROGRAMS = q-gears-ffvii
 
-q_gears_ffvii_CPPFLAGS = -I $(top_srcdir)/src -I $(top_builddir)/src @[email protected] @[email protected]
+q_gears_ffvii_CPPFLAGS = -I $(top_srcdir)/src -I $(top_builddir)/src @[email protected]
 
 q_gears_ffvii_SOURCES = \
  \
@@ -12,14 +12,17 @@
  field/Trigger.h field/Trigger.cpp \
  field/DatFile.h field/DatFile.cpp \
  field/DatXmlFile.h field/DatXmlFile.cpp \
+ field/Entity.h field/Entity.cpp \
  field/FieldModule.h field/FieldModule.cpp \
  field/FieldUtilites.h field/FieldUtilites.cpp \
+ field/Line.h field/Line.cpp \
+ field/MarkTriangle.h field/MarkTriangle.cpp \
  field/Model.h field/Model.cpp \
- field/UnitManager.h field/UnitManager.cpp \
+ field/ObjectManager.h field/ObjectManager.cpp \
+ field/ScreenManager.h field/ScreenManager.cpp \
+ field/Script.h field/Script.cpp \
+ field/WalkMeshTriangle.h field/WalkMeshTriangle.cpp \
  field/WindowManager.h field/WindowManager.cpp \
- field/script/Entity.h field/script/Entity.cpp \
- field/script/Script.h field/script/Script.cpp \
- field/script/ScriptManager.h field/script/ScriptManager.cpp \
  \
  filesystem/File.h filesystem/File.cpp \
  filesystem/FileStream.h \
@@ -30,7 +33,7 @@
  filetypes/TimFile.h filetypes/TimFile.cpp \
    filetypes/image/Vram.h filetypes/image/Vram.cpp \
  \
- kernel/Database.h kernel/Database.cpp \
+ kernel/DataBase.h kernel/DataBase.cpp \
  kernel/GameState.h kernel/GameState.cpp \
  kernel/Savemap.h \
  kernel/Kernel.h kernel/Kernel.cpp \
@@ -54,6 +57,7 @@
         kernel/gui/GuiDigit.h kernel/gui/GuiDigit.cpp \
  kernel/gui/GuiPointer.h kernel/gui/GuiPointer.cpp \
  kernel/gui/GuiSlash.h kernel/gui/GuiSlash.cpp \
+ kernel/gui/GuiMarkTriangle.h kernel/gui/GuiMarkTriangle.cpp \
  \
  menu/Menu.h menu/Menu.cpp \
  menu/PartyMenu.h menu/PartyMenu.cpp \
@@ -77,5 +81,4 @@
  @[email protected] \
  @[email protected] \
  @[email protected] \
- @[email protected] \
-        @[email protected]
+ @[email protected]
--- ./src/common/TypeDefine.h
+++ ./src/common/TypeDefine.h
@@ -13,7 +13,7 @@
 

 

 

-#ifndef HAVE_INTTYPES_H

+#ifdef HAVE_INTTYPES_H

 # include <inttypes.h>

 #elif defined(_MSC_VER)

 typedef unsigned __int8    uint8_t;



halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Hello! Q-Gears is really hard to compile
« Reply #9 on: 2007-02-12 04:26:44 »
I applied the patch and uploaded the changes (With some tweaks) to SVN. I'm trying to get it to compile now.

After I'm done, You guys might want to update to the latest SVN to see if I didn't break anything.

==UPDATE==

Well, I got the FF7 half of q-gears to compile under linux, but I'm greeted with a segfault when I run it

Here is the game.log output

Code: [Select]
[06:57:36] Kernel inited.
[06:57:36] Init game state.
[06:57:36] Loading file: data/savemap
[06:57:36] Can't open file data/savemap
[06:57:36] Can't open file data/savemap
[06:57:36] Warning: data/savemap not found!
[06:57:36] Game state inited.
[06:57:36] Init game database.
[06:57:36] Loading file: INIT/KERNEL.BIN
[06:57:36] Game database inited.
[06:57:36] SDL_INIT_TIMER initialized
[06:57:36] ===================== Start the game!!!
[06:57:36] Field module start.

So pretty much the game gets to that and just dies. (I don't see a splash screen at all) Any of you other linux geeks have any luck?
« Last Edit: 2007-02-12 06:03:35 by halkun »

Googly

  • Guest
Re: Hello! Q-Gears is really hard to compile
« Reply #10 on: 2007-02-13 04:29:38 »
Have you tried running it through GDB?
My copy ran fine, and I must say I am impressed.
At least I know I'm not the only one with trouble if the project leader can't get it to run!  :-P

My main trouble (after compilation) was getting all the files into the right places...

Here's my directory layout:
Code: [Select]
config.ini
q-gears-ffvii
data/savemap
data/splash.bmp
data/FF7 data files from cd and .11 binary release
« Last Edit: 2007-02-13 04:37:31 by Googly »

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Hello! Q-Gears is really hard to compile
« Reply #11 on: 2007-02-13 06:33:04 »
My main trouble (after compilation) was getting all the files into the right places...

The best thing will be download windows binaries and look at directory and files layout there =)

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Hello! Q-Gears is really hard to compile
« Reply #12 on: 2007-02-13 08:17:33 »
At least I know I'm not the only one with trouble if the project leader can't get it to run!  :-P


The project leader was on a six-month vacation while going to school and getting his degree :P Actually, Q-gears has *never* ran correctly for me without extensive hacking, so I'm quite used to the segfaults, but before it was because the only development computer I had was a laptop with a broken intel mobile chipset. OpenGL segfaulted when it tried to do anything "cool" because X didn't realize that the graphics system was the mobile version and was missing functionality.

They fixed this in a later driver release by diableing hardware OpenGL. >_<

Now I have a new computer system and trying to get myself up to speed. I'll get there....
« Last Edit: 2007-02-13 08:19:34 by halkun »

G

  • *
  • Posts: 104
  • , kupo.
    • View Profile
Re: Hello! Q-Gears is really hard to compile
« Reply #13 on: 2007-02-15 07:36:46 »
I fixed Linux autoconf/automake files and some stuff in xeno (please check someone, if I don't break another projects) - now project compiles under Linux again ;) - it's a good news, the bad news is:

Quote
So pretty much the game gets to that and just dies. (I don't see a splash screen at all) Any of you other linux geeks have any luck?
halkun, the same segfault for me. Maybe I will check it today...

G

  • *
  • Posts: 104
  • , kupo.
    • View Profile
Re: Hello! Q-Gears is really hard to compile
« Reply #14 on: 2007-02-15 07:55:14 »
segfaults here:
field/DatFile.cpp:67
    Script* script = new Script(mpBuffer + offset_to_sector + script_offset, script_size);

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Hello! Q-Gears is really hard to compile
« Reply #15 on: 2007-02-15 09:20:43 »
segfaults here:
field/DatFile.cpp:67
    Script* script = new Script(mpBuffer + offset_to_sector + script_offset, script_size);


Script::Script(u8* pBuffer, const u32& ulLength):
    m_pBuffer(NULL),
    m_ulLength(ulLength)
{
    assert(pBuffer != NULL);

    m_pBuffer = (u8*)malloc(sizeof(u8) * m_ulLength);
    memcpy(m_pBuffer, pBuffer, m_ulLength);
}

I think it may be in memcpy if pBuffer in wrong length =(
But I don't know why you encount this trouble.... maybe level file incorrect or something like this?