Flambe HTML Compile Issue - haxe

I have just started with Haxe/Flambe, but I seem to have a problem compiling to HTML. From what I can tell it's an internal problem. It compiles to Flash just fine. Here's my console output
C:\Users\UserName\Dropbox\Projects\Project\Game>flambe build --debug html
Building: build/web
haxe -main game.Main -lib flambe -cp src -dce full -debug --no-opt --no-inline -D html -D js-es5 -D js-flatten --macro flambe.platform.ManifestBuilder.use("build/web/assets") -D source-map-content -js
build/web/targets/main-html.js
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlPlatform.hx:76: characters 8-41 : js.html.DOMElement should be js.html.Element
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : Array<Int> should be haxe.io.BytesData
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : Array<Int> should be js.html.ArrayBuffer
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:44: characters 28-32 : For function argument 'b'
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/CanvasTextureRoot.hx:39: lines 39-45 : Missing return haxe.io.Bytes
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:364: characters 16-38 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:367: characters 12-37 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:368: characters 16-42 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlAssetPackLoader.hx:205: characters 12-43 : String should be js.html.XMLHttpRequestResponseType
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:37: characters 42-48 : js.html.Window should be haxe.Function
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:37: characters 42-48 : For function argument 'func'
C:\HaxeToolkit\haxe\lib\flambe/4,1,0/flambe/platform/html/HtmlExternal.hx:25: lines 25-38 : Missing return Dynamic
I am using Haxe 3.2.0 and Flambe 4.1.0.
I have been crawling the internet looking for a solution, but couldn't seem to find one. Any help would be much appreciated.
Thanks.

If you want to use Flambe with Haxe 3.2, you should apply this patch:
https://github.com/aduros/flambe/commit/ec084011873cf16635f4e2a77cc0d2dc6c58625d

Alright, well downgrading Haxe 1.3.1 seemed to fix the problem.
Here are the steps in case anyone else comes across this.
1) Go to C:\HaxeToolkit and there should be an uninstall.exe, run that to uninstall Haxe.
2) Install Haxe 1.3.1 from here: http://haxe.org/download/file/3.1.3/haxe-3.1.3-win.exe
3) Run the following commands from cmd to install flambe:
npm install -g flambe
flambe update
Hope this helps anyone who had the same problem.

Related

How to set values in Makefile.poisx

I am trying to build nrfsdk for the nrf52840 armgcc, running make gives following error.
su#su-desktop:~/nRF/nRF5_SDK_17.1.0_ddde560/examples/peripheral/template_project/pca10056/blank/armgcc$ make
/home/su/gcc-arm-none-eabi/bin/arm-none-eabi-gcc: 1: cannot open ##P�#8: No such file
/home/su/gcc-arm-none-eabi/bin/arm-none-eabi-gcc: 1: Syntax error: Unterminated quoted string
Cannot find: '/home/su/gcc-arm-none-eabi/bin/arm-none-eabi-gcc'.
Please set values in: "/home/su/nRF/nRF5_SDK_17.1.0_ddde560/components/toolchain/gcc/Makefile.posix"
according to the actual configuration of your system.
../../../../../../components/toolchain/gcc/Makefile.common:129: *** Cannot continue. Stop.
su#su-desktop:~/nRF/nRF5_SDK_17.1.0_ddde560/examples/peripheral/template_project/pca10056/blank/armgcc$
make sure you actually have the arm-none-eabi-gcc toolchain installed.
arm-none-eabi-gcc --version
if you don't have it, you can find it here: https://developer.arm.com/downloads/-/gnu-rm
if you do have it installed but are not sure of where to find it, run this
$ whereis arm-none-eabi-gcc
arm-none-eabi-gcc /opt/arm-none-eabi-gcc/bin/arm-none-eabi-gcc <-- this line can be different for you
then you can edit the Makefile.posix file (ex by opening it in a text editor)
go to the directory of your nrfSDK install, then components>toolchain>gcc>Makefile.posix
and edit the GNU_INSTALL_ROOT field (for me that was /opt/arm-none-eabi-gcc/bin) and GNU_VERSION field to whatever toolchain version you installed (9.3.1 in my case)
Hope it helps :)

ANTLR: code generation target requires ANTLR 4.7; it can't be loaded by the current ANTLR 1.0

I have a problem with ANTLR4, (ANother Tool for Language Recognition) when trying to build a new target for PHP7.
First I purged the installed ANTLR3 package with
apt-get remove --purge antlr antlr-doc libantlr3-runtime-java libantlr-java
from the Debian Linux box I am using.
Then I forked and cloned the project ANTLR4 from github, programmed a new runtime PHP7, created a new class PHP7Target as a subclass of class Target and wrote a fitting PHP7.stg.
Then I rebuilt ANTLR4 with
cd antlr4
export MAVEN_OPTS=-Xmx1G
mvn clean
mvn -DskipTests=true install
Using the grammar T.g4
grammar T;
a
: 'b' #alt1
| 'c' #alt2
;
b : 'x' | 'y' {} ;
e : e '*' e
| 'foo'
;
Trying to run ANTLR4 with
export CLASSPATH=~/.m2/repository/org/antlr/antlr4/4.7.1-SNAPSHOT/antlr4-4.7.1-SNAPSHOT-complete.jar:$CLASSPATH
cd ~/.m2/repository/org/antlr/antlr4/4.7.1-SNAPSHOT
java -jar ./antlr4-4.7.1-SNAPSHOT-complete.jar /tmp/T.g4 -Dlanguage=PHP7
I ran into the error
error(35): PHP7 code generation target requires ANTLR 4.7; it can't be loaded by the current ANTLR 1.0
The error displays two times.
Without the option -Dlanguage=PHP7 ANTLR will do its job and create the java-files for the grammar.
Unfortunately I do not understand the error message. It seems, that an old ANTLR version is in use by the package and I do not know how to upgrade ANTLR to version 4 in this case.
Can anybody help and tell me where my error is, please?
Solution:
In the file PHP7target.java there is a method called getVersion(). This function should not return the version of the runtime (ie "1.0") but the version of ANTLR ("4.7")

Cygwin : error: package net.jradius.packet.attribute does not exist

This doesn't appear to be the usual CLASSPATH issue, but maybe something specific to cygwin.
The following illustrates the issue.
import net.jradius.packet.attribute.AttributeFactory;
public class Test{
static int x = 100;
}
When compiling the following error appears.
$ javac Test.java
Test.java:1: error: package net.jradius.packet.attribute does not exist
import net.jradius.packet.attribute.AttributeFactory;
^
1 error
The file jradius-core-1.1.4.jar is in the CLASSPATH.
When using the command line within Windows it works. Here is the classpath.
set CLASSPATH=c:\Temp\jradius-core-1.1.4.jar
When using cygwin it produces the error. Here is the classpath.
export CLASSPATH=/cygdrive/c/Temp/jradius-core-1.1.4.jar
The location is valid via cygwin as the following shows it is recognized.
ls $CLASSPATH
/cygdrive/c/Temp/jradius-core-1.1.4.jar
The same JDK is used for both scenarios.
Any idea why it may be failing via cygwin???
You are using JDK built for windows, so the environment is for windows.
That's being said, you should be provide windows-style path to javac.
cygpath is what you are looking for here.
Try:
javac Test.java -cp `cygpath.exe -w /cygdrive/c/Temp/jradius-core-1.1.4.jar`
cygpath -w means print in windows style.
Or just put the jar file in the same directory of the java file, and in cygwin:
javac Test.java -cp jradius-core-1.1.4.jar
Refer from this
Added the JAR files into the directory and changed the classpath to include '*' and that appears to have worked.

java.lang.IllegalArgumentException: Not a valid class name: ANDROID NDK javah

Im learning to code Android in NDK on WINDOWS Eclipse.... been following a Tutorial Book by Sylvain Ratabouil. So im in Run | External Tools | External Tools Configurations…
creating a new program configuration.
Name: MyProject javah
Location : ${env_var:JAVA_HOME}\bin\javah.exe
Working directory: ${workspace_loc:/MyProject/bin}
The problem comes In arguments...
when i try
Arguments: –d ${workspace_loc:/MyProject/jni} com.myproject.MyActivity
as it says in the book
i get when i click run
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: –d
when i try ${workspace_loc:/MyProject/jni} com.myproject.MyActivity}
i get
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: C:\Paul\Workspace\MyProject\jni
UPDATE:
i put -classpath first and it's running but can not find the class file for com.myproject
after further research....
i did it.
i set arguments to
-d ${workspace_loc:/MyProject/jni} -classpath C:\Paul\android-sdk-windows\platforms\android-17\android.jar;${workspace_loc:/MyProject/bin/classes} com.myproject.MainActivity
I also spend some long time on this problem when working with the the mentioned book about Android NDK.
Please note the following:
The java classname is NOT written in { }, just write something like com.myproject.MyActivity
The -classpath parameter can receive several paths devided by semicolon.
In my case this parameters worked:
Location:
${env_var:JAVA_HOME}\bin\javah.exe
Working Directory:
${workspace_loc:/myproject/bin}
Arguments:
-d ${workspace_loc:/myproject/jni} -classpath ${workspace_loc:/myproject/bin/classes};"C:\Eclipse\sdk\platforms\android-18\android.jar" com.myproject.MyActivity
(BTW.: The correct Adroid.jar file is referenced inside the Eclipse project.)
Me also facing the same problem tonight, i found a less tedious way as following...
as "Location" set the javah from your system
as "Working directory" set the project's bin/classes directory (${workspace_loc:/HelloWorld/bin/classes})
as "Argument" set the jni folder as the output directory and point out the class on which you want to run the javah (-d "${workspace_loc:/HelloWorld/jni}" com.example.helloworld.MainActivity)
NB :: Dont forget the double qoute (") around the output in the third step ("${workspace_loc:/HelloWorld/jni}")
A full picture is also attached following
well in case ...
1-> Goto ( cd C:\Program Files\Java\jdk1.7.0_60\bin)
2-> C:\Program Files\Java\jdk1.7.0_60\bin>javah -jni -classpath
F:\Android_OpenGLES\FibonacciNative\bin\classes
-d F:\Android_OpenGLES\FibonacciNative\jni\ com.example.fibonaccinative.FibLib
without creating/using environment variable ...
Following I tried successfully
javah com.sense.kios.Calculation
Note: Include package name.
In case if javah not found as an command and you getting
The program 'javah' can be found in the following packages:
* gcj-4.6-jdk
* gcj-4.7-jdk
* openjdk-7-jdk
* openjdk-6-jdk
Try: sudo apt-get install <selected package>
use direct path of jdk path, in my case it's /usr/lib/jvm/jdk1.8.0/bin/javah.
YES THAT'S CORRECT
more abstract would be
-d ${workspace_loc:/MyProject/jni} -classpath ${env_var:ANDROID_SDK_HOME}\platforms\android-16\android.jar;${workspace_loc:/MyProject/bin/classes} com.myproject.MyActivity

"No classes were specified on the command line" error running javah

I'm on Windows 7, using javah in Cygwin 1.7.13. I'm currently attempting to generate the header file for a native C++ file for my Android project.
Run in the root of the project, the command I'm executing is:
walb#nought /cygdrive/c/Users/walb/stuff/work/workspace/SoundBites
$ javah -verbose -d jni/ -classpath bin/classes uk.co.biogen.SoundBites.activity.SoundBitesActivity
Which results in:
error: cannot access uk.co.biogen.SoundBites.activity.SoundBitesActivity
class file for uk.co.biogen.SoundBites.activity.SoundBitesActivity not found
javadoc: error - Class uk.co.biogen.SoundBites.activity.SoundBitesActivity not found.
[ Search Path: C:\Program Files\Java\jdk1.6.0_22\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\sun
rsasign.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\charsets.j
ar;C:\Program Files\Java\jdk1.6.0_22\jre\classes\bin/classes ]
Error: No classes were specified on the command line. Try -help.
Most of the topics I've read indicate that I've got the -classpath argument correct. The interesting bit of the error message is:
[ Search Path: C:\Program Files\Java\jdk1.6.0_22\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\sun
rsasign.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_22\jre\lib\charsets.j
ar;C:\Program Files\Java\jdk1.6.0_22\jre\classes\bin/classes ]
The last path in that list is C:\Program Files\Java\jdk1.6.0_22\jre\classes\bin/classes, which indicates javah is interpreting the argument completely wrong. The only thing I can think might help is some alternative way of calling javah, but adding its directory to PATH is the only means I can think of.
Just implemented what I wanted in native Android. It's easier to integrate and understand what's going on, at the expense of speed and actually doing what I wanted in the first place.
Does this work (adding a semi-colon before your path for the -classpath argument):
javah -verbose -d jni/ -classpath ;bin/classes uk.co.biogen.SoundBites.activity.SoundBitesActivity

Resources