• entries
63
56
• views
44394

# MultiMethod fixed

343 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.

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.

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.

The error is in the Loki code (posted below for completeness):
    template
<
std::size_t chunkSize = DEFAULT_CHUNK_SIZE,
std::size_t maxSmallObjectSize = MAX_SMALL_OBJECT_SIZE
>
{

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,

public:
static void* operator new(std::size_t size)
{
#if (MAX_SMALL_OBJECT_SIZE != 0) && (DEFAULT_CHUNK_SIZE != 0)
(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)
(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.

## Create an account

Register a new account

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.