Monday, December 10, 2012

FlasCC: 1st experience

1) Download and extract FlasCC zip
2) try making the Hello sample. eg.: ..\..\sdk\usr\bin\make FLASCC="../../sdk" FLEX="../../../flex_sdk_4.6"
3) error
"-------- Sample 1 --------

First let's compile it as a projector:
"../../sdk/usr/bin/gcc" -Werror -Wno-write-strings -Wno-trigraphs hello.c -o hel
lo.exe
cc1: error in backend: Failed to run /cygdrive/c/Program Files/Git/bin/which wit
h args: java
Error:
/cygdrive/c/Program Files/Git/bin/which: line 7: $'\r': command not found

make: *** [T01] Error 1"

4) use dosunix on the "which" in Git\bin

5) then run again, another error
"LLVM ERROR: Error: Unable to launch the Java Virtual Machine.
This usually means you have a 32bit JVM installed or have set your Java heap siz
e too large.
Try lowering the Java heap size by passing "-jvmopt=-Xmx1G" to gcc/g++.
Stack dump: [blah blah ....]

make: *** [T01] Error 1"

6) added '-jvmopt="-Xmx1G"' to Makefile
"T01: check
@echo "-------- Sample 1 --------"
@echo && echo "First let's compile it as a projector:"
"$(FLASCC)/usr/bin/gcc" $(BASE_CFLAGS) -jvmopt="-Xmx1G" hello.c -o hello.exe

@echo && echo "Now lets compile it as a SWF:"
"$(FLASCC)/usr/bin/gcc" $(BASE_CFLAGS) -jvmopt="-Xmx1G" hello.c -emit-swf -swf-size=200x200 -o hello.swf

include ../Makefile.common

clean:
rm -f hello.swf hello *.bc *.exe"

7) finally no error and EXE and SWF generated.

1 comment:

Anonymous said...

I would never have figured out where to put that -jvmopt="-Xmx1G". without your post. thnaks