开发者

Error #1006 value is not a function in C++ code compiled by Alchemy

开发者 https://www.devze.com 2022-12-22 05:53 出处:网络
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

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 开发者_StackOverflow中文版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?

0

精彩评论

暂无评论...
验证码 换一张
取 消