[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Massrebuilds for GCC 4.3 coming soon to a buildsystem near you!

Jon Ciesla wrote:
On Wed, 13 Feb 2008 07:25:56 -0600 (CST), Jon Ciesla wrote:

I've got all mine patched and done for 4.3 but xmoto, which I've got
partway fixed but am stuck.  Anyone understand this?

Scene.o: In function `CollisionSystem::CollisionSystem()':
undefined reference to `ElementHandler<Entity>::reset()'

This usually means that the definition of
class template ElementHandler's member function reset is not included
in the translation unit, only the declaration.

Find out where it's defined, and make sure that scene.cpp includes
It's defined in Collision.h in the parent directory, and it is included
Scene.cpp, but I noticed in Scene.h it uses:

#include "Collision.h"

rather than:

#include "../Collision.h"

So I patched that, but it doesn't help.
It's declared in Collision.h but defined only in Collision.cpp, which
doesn't work as it is a template. The author had tried to also move the
ctor into the .cpp file and mentions in a comment that it didn't compile.
Moving the definition of ElementHandler<T>::reset() method into the
Collision.h file would fix this (but it's likely not the only definition
that needs to be moved).

That makes sense.  As my c++ are not quite up to this, I've sent this
upstream.  Thanks all!

Attached is a patch which fixes this by un-inlining the Collision constructor. Actually it seems that the best way to fix this is to un-inline all Collision members which use the template and move the template entirely to Collision.cpp


--- xmoto-0.4.0/src/Collision.cpp	2008-01-18 22:48:25.000000000 +0100
+++ xmoto-0.4.0.new/src/Collision.cpp	2008-02-13 16:17:03.000000000 +0100
@@ -51,6 +51,12 @@
                                     } \
+  CollisionSystem::CollisionSystem()
+  {
+    m_pGrid = NULL; m_bDebugFlag=false;
+  }
   Reset collision system
--- xmoto-0.4.0/src/Collision.h	2007-12-25 18:15:39.000000000 +0100
+++ xmoto-0.4.0.new/src/Collision.h	2008-02-13 16:01:10.000000000 +0100
@@ -147,7 +147,7 @@
   class CollisionSystem {
-    CollisionSystem() {m_pGrid = NULL; m_bDebugFlag=false;}
+    CollisionSystem();
     ~CollisionSystem() {reset();}
     /* Methods */

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]