1 Reply Latest reply: Feb 20, 2012 9:34 AM by cjpfromcq RSS

    err :Undefined sym: __ZN3FooC1Ev   at Function/<anonymous>()

    cjpfromcq

      Foo.h

      #pragma once

      class Foo

      {

      public:

        Foo(int n);

        virtual ~Foo(void);

        int Plus(int m);

        int num2;

      };

       

       

      Foo.cpp

      #include "Foo.h"

      Foo::Foo(int n)

      {

        num2=n;

      }

      Foo::~Foo(void)

      {

      }

      int Foo::Plus(int m)

      {

        int n=100+m+num2;

        return n;

        

      }

       

       

       

       

               

      main.cpp

      #include <stdlib.h>

      #include <stdio.h>

      #include "Foo.h"

      #include "AS3.h"

       

       

      static AS3_Val fc(void* self, AS3_Val args)

      {

              

        Foo f(10);

        int m=f.Plus(1);

       

        return AS3_Int(m);

        

      }

       

      int main()

      {

            

              AS3_Val fcMethod = AS3_Function( NULL, fc );

              AS3_Val result = AS3_Object( "fc:AS3ValType",  fcMethod  );

              AS3_Release(  fcMethod  );    

              AS3_LibInit( result );

       

              return 0;

      }

       

      there is the source.why always err:

      Undefined sym: __ZN3FooC1Ev

        at Function/<anonymous>()

        at Function/<anonymous>()

       

       

      who can help me ???