adobe-flash / crossbridge

Welcome to visit the homepage!
http://www.crossbridge.io
543 stars 198 forks source link

getting started #54

Open ddyer0 opened 10 years ago

ddyer0 commented 10 years ago

I'm no novice, but I've been unable to get the samples to compile or find any active support forum.

On Windows 7, the complaint is LLVM ERROR: Error: Unable to launch the Java Virtual Machine. I have about a dozen JVMs installed, the default is 64 bit java 1.8_05

It would help if there were some FAQ about specifying explicitly what JVM to use. Or a more visible community forum. The adobe forum is essentially unused.

vpmedia commented 10 years ago

Try setting JAVA_OPTS environment variable (-Xms1024m -Xmx8192 in my example): http://docs.ubmatrix.com/webhelp/xda/1_0_1/Configure_Java_Environment_Options_%28JAVA_OPTS%29.htm

ddyer0 commented 10 years ago

Setting JAVA_OPTS environment variable made no difference, but I eventually succeeded by adding -jvmopt=-Xmx1G to BASE_CFLAGS in Makefile.common

The next stumble is while compiling sample 5 -------- Sample 5 --------

Now compile a SWC and demo SWF "/cygdrive/c/crossbridge/sdk/usr/bin/g++" -Werror -Wno-write-strings -Wno-trigraphs -jvmopt=-Xmx1G -O4 MurmurHash3.cpp a s3api.cpp main.cpp -emit-swc=sample.MurmurHash -o MurmurHash.swc "C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0/bin/mxmlc" -static-link-runtime-shared-libraries -co mpiler.omit-trace-statements=false -library-path=MurmurHash.swc -debug=false swcdemo.as -o swcdemo.swf dirname: extra operand Files\\Adobe\\Adobe' Trydirname --help' for more information. Error: Unable to access jarfile C:/crossbridge/cygwin/lib/mxmlc.jar Makefile:2: recipe for target T05' failed make[2]: *** [T05] Error 1 make[2]: Leaving directory/cygdrive/c/crossbridge/samples/05_SWC' Makefile:35: recipe for target T05' failed make[1]: *** [T05] Error 2 make[1]: Leaving directory/cygdrive/c/crossbridge/samples' Makefile:2: recipe for target `all' failed make: *\ [all] Error 2

vpmedia commented 10 years ago

Looks like a path issue: Try using: $(call nativepath,$(FLEX)) Or directly: $(shell cygpath -at mixed $(FLEX)) Also space in path names could lead to errors, you can move the sdk or use shortened path: /cygdrive/c/Progra~1/Flex... Also you can use AIR SDK instead of Flex: https://www.adobe.com/devnet/air/air-sdk-download.html

ddyer0 commented 10 years ago

It was a path issue, moving the target sdk to /cygdrive/c/crossbridge/4.6.0 worked

ddyer0 commented 10 years ago

Where does the default value (that I had to override) -Xmx1500M come from? It doesn't appear anywhere in distribution that I can find.

vpmedia commented 10 years ago

https://github.com/adobe-flash/crossbridge/blob/master/llvm-gcc-4.2-2.9/gcc/config/avm2/avm2.h line 158

I've removed this in my fork because I think it's better to depend on JAVA_OPTS env. or supply by param.

ddyer0 commented 10 years ago

After the above, the "samples" build still failed on sample 5.

My explanation is that my typical devlopers path is full of all kinds of stuff, including perl, msvc, some version or other of cygwin, some random unix command tools, and so on. I eventually fixed the rest of the samples build process by cleaning up my path.

In run.bat, before the path modification

#

set a minimal path to avoid contamination of the environment with unexpected programs

note this includes the JDK path we want to use

# set path=C:\java\jdk1.8.0\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem; #