1

I have an AS3 AIR project in which I need to decompress files using a specific decompression method. Apparently the code for this is found here, in the contrib/blast directory of the zlib distribution. I would port this to AS3 manually, however I'm practically illiterate in C/C++ and don't have much experience in coding compression/decompression algorithms either.

I discovered FlasCC, and decided to download it and see if it works. The hello world sample worked well and everything. I looked up how to compile SWCs, since I figured that would be a good form to use it in, and attempted to compile it. Unfortunately it didn't work.

This is what I write:

$ "/cygdrive/f/C2F/FlasCC/sdk/usr/bin/gcc" blast.c -emit-swc=blast -o blast.swc

And this is what I get:

/cygdrive/f/C2F/FlasCC/sdk/usr/bin/../../usr/lib/stdlibs_abc/crt1_c.o: error: un
defined reference to '_main'
collect2: ld returned 1 exit status

As I mentioned I'm completely useless at C, and this is the first time I've used FlasCC. If anybody could tell me what I'm doing wrong, or even just provide an alternative, it would be greatly appreciated.

puggsoy
  • 1,270
  • 1
  • 11
  • 34

1 Answers1

2

swc requires a main entry point.. add:

int main() 
{ 
    AS3_GoAsync();
}
trizos
  • 21
  • 2
  • When I paste in that code, I now get: `/tmp/cc3Ol8dV.o: error: undefined reference to '_AS3_GoAsync' collect2: ld returned 1 exit status`. I'm sorry, I really am useless at this. Am I supposed to be better experienced with C to use FlasCC? – puggsoy Mar 11 '13 at 06:45
  • Well I figured that I had to include AS3.h and it finally compiled. I can't seem to use it properly in AS3 though. I'll see if the SWC sample helps though. – puggsoy Mar 11 '13 at 07:14