Skip navigation
ggambett
Currently Being Moderated

Error #1006: value is not a function

Mar 5, 2010 2:08 PM

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?

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points