0 Replies Latest reply on Mar 12, 2016 12:01 AM by parvezk66448402

    How do I implement console in SWC (Inadequate references and documentation)

    parvezk66448402

      I want to compile a simple c printf command in flascc via swc only.

      Alchemy used to prinf by default in the trace / output window of flash.

      I have checked / searched all available references and resources on net but could find anything to help me with .

      FlasCC has a Console implementation which i need some help on.

      I have used default console.as file

       

      In flash file

      --------------------------------------

          CModule.startAsync(this);

          MurmurHash3()

         

       

      sample.c

      --------------------------------------------

          #include <stdio.h>

          #include <stdlib.h>

          #include <string.h>

          #include "AS3/AS3.h"

         

          void MurmurHash3() __attribute__((used,

          annotate("as3sig:public function MurmurHash3():void"),

          annotate("as3package:com.xxx.xxxxx")));

         

          void MurmurHash3()

          {

          printf("wow3");

          }

         

          int main()

          {

          printf("wow1");

          AS3_GoAsync();

          printf("wow2");

          }

         

      MAKEFILE

      ----------------------------------------

          $(AS3COMPILERARGS) -strict -AS3 \

          -import $(call nativepath,$(FLASCC)/usr/lib/builtin.abc) \

          -import $(call nativepath,$(FLASCC)/usr/lib/ISpecialFile.abc) \

          -import $(call nativepath,$(FLASCC)/usr/lib/CModule.abc) \

          -import $(call nativepath,$(FLASCC)/usr/lib/playerglobal.abc) \

          -import $(call nativepath,$(FLASCC)/usr/lib/PlayerKernel.abc) \

          Console.as -outdir . -out Console

        

          "$(FLASCC)/usr/bin/gcc" -c sample.c -jvmopt=-Xmx1G

        

          "$(FLASCC)/usr/bin/gcc" sample.o -symbol-abc=Console.abc -emit-swc=com.xxx.xxxxx -o xxxx.swc -jvmopt=-Xmx1G

       

       

      I have added the reference of generated swc in the library path of flash

      Yet unable to get the 'printf'