views:

109

answers:

0

I'm trying to port a big library to Alchemy. I've run into something that looks like an Alchemy bug. I have a class with a static member. There's a static function that uses it. Something like this:

In foo.h:

class Foo
{
    static Bar m_pBar;
    static void doSomething (int a);
}

In foo.cpp:

Bar Foo::m_pBar;

void Foo::doSomething (int a)
{
    m_pBar.doSomething(a);
}

When I do Foo::doSomething(a), I get TypeError: Error #1006: value is not a function.

On the other hand, if I use a local variable of the same type in the static function (just to test), it works :

void Foo::doSomething (int a)
{
    // Test
    Bar pBarTest;
    pBarTest.doSomething(a);
}

So my guess is that the static variable is not being initialized. This works fine when compiled with g++ in Linux and Mac and with Visual C++ 2008 in Windows so it looks like Alchemy is doing something wrong.

Has anyone encountered this same issue?