Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    63
  • comments
    56
  • views
    44319

MultiMethod fixed

Sign in to follow this  
rick_appleton

318 views

Yesterday I was testing Daedalus on Dev-C++ again, and I found out what was wrong with the MultiMethods. So that works now, and Collision Detection/Handling should be a breeze to set up now. I'll be doing that this evening.

The Dev-C++ port is giving my some strange errors though, so not all is well.

Still need to figure out what's wrong with the Linux release build, but I should be working on my thesis, so I dont' really have time to investigate all too much.
Sign in to follow this  


3 Comments


Recommended Comments

I've got some experience in solving cross-compiler problems thanks to me coding for both Linux and Windows. Even different versions of GCC will produce different errors (notably the 3.4.x versions) so if you post some, I might be able to point you in the right direction if they're the ones I've had.

Share this comment


Link to comment
Thank you. The Dev-C++ (using gcc 3.4.2) errors had to do with Loki. I can't remember them exactly, so if I can't solve them tonight I'll post back here.

The Linux release build are only linker errors. That's probably due to me having almost no experience with Eclipse, and setting some flag which I shouldn't have.

Share this comment


Link to comment
The error is in the Loki code (posted below for completeness):

template
<
template <class> class ThreadingModel = DEFAULT_THREADING,
std::size_t chunkSize = DEFAULT_CHUNK_SIZE,
std::size_t maxSmallObjectSize = MAX_SMALL_OBJECT_SIZE
>
class SmallObject : public ThreadingModel<
SmallObject<ThreadingModel, chunkSize, maxSmallObjectSize> >
{
typedef ThreadingModel< SmallObject<ThreadingModel,
chunkSize, maxSmallObjectSize> > MyThreadingModel;

struct MySmallObjAllocator : public SmallObjAllocator
{
MySmallObjAllocator()
: SmallObjAllocator(chunkSize, maxSmallObjectSize)
{}
};
// The typedef below would make things much simpler,
// but MWCW won't like it
// typedef SingletonHolder<MySmallObjAllocator/*, CreateStatic,
// DefaultLifetime, ThreadingModel*/
> MyAllocator;


public:
static void* operator new(std::size_t size)
{
#if (MAX_SMALL_OBJECT_SIZE != 0) && (DEFAULT_CHUNK_SIZE != 0)
typename MyThreadingModel::Lock lock;
(void)lock; // get rid of warning

return SingletonHolder<MySmallObjAllocator, CreateStatic,
PhoenixSingleton>::Instance().Allocate(size);
#else
return ::operator new(size);
#endif
}
static void operator delete(void* p, std::size_t size)
{
#if (MAX_SMALL_OBJECT_SIZE != 0) && (DEFAULT_CHUNK_SIZE != 0)
typename MyThreadingModel::Lock lock;
(void)lock; // get rid of warning

SingletonHolder<MySmallObjAllocator, CreateStatic,
PhoenixSingleton>::Instance().Deallocate(p, size);
#else
::operator delete(p);
#endif
}
virtual ~SmallObject() {}
};



Error:
148 D:\dev\Daedalus_Development_Win\Daedalus_Lib\Loki\Reference\SmallObj.h expected identifier before '(' token
148 D:\dev\Daedalus_Development_Win\Daedalus_Lib\Loki\Reference\SmallObj.h abstract declarator `void*' used as declaration
148 D:\dev\Daedalus_Development_Win\Daedalus_Lib\Loki\Reference\SmallObj.h expected `;' before '(' token
160 D:\dev\Daedalus_Development_Win\Daedalus_Lib\Loki\Reference\SmallObj.h expected `;' before "void"
160 D:\dev\Daedalus_Development_Win\Daedalus_Lib\Loki\Reference\SmallObj.h expected identifier before '(' token

Line 148 is the line of the operator new overload declaration, and line 160 is the line of the operator delete overload. I'll be posting this error on the Loki forums as well to see if they can do anything with it.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!