Calling any macro function seems to break Lime Assets and Lime in general. Am I doing something wrong?
package main;
import haxe.macro.Expr;
import lime.Assets;
import lime.app.Application;
/**
* ...
* @author Simon
*/
class Main extends Application
{
public function new()
{
super();
}
override public function exec():Int
{
trace( add(1) );
trace( Assets.getText( "assets/thing.txt" ) );
return super.exec();
}
macro static function add(e:Expr) {
return macro $e + $e;
}
}
I get these errors
Building Macros
Running Pre-Build Command Line...
cmd: "C:\HaxeToolkit\haxe/haxelib" run lime build "project.xml" neko -release -Dfdb
C:/HaxeToolkit/haxe/lib/lime/2,9,1/lime/_backend/native/NativeWindow.hx:134: characters 15-38 : Unknown identifier : lime_window_get_display
C:/HaxeToolkit/haxe/lib/lime/2,9,1/lime/_backend/native/NativeWindow.hx:227: characters 20-41 : Unknown identifier : lime_window_get_width
C:/HaxeToolkit/haxe/lib/lime/2,9,1/lime/_backend/native/NativeWindow.hx:228: characters 21-43 : Unknown identifier : lime_window_get_height
C:/HaxeToolkit/haxe/lib/lime/2,9,1/lime/_backend/native/NativeWindow.hx:229: characters 16-33 : Unknown identifier : lime_window_get_x
C:/HaxeToolkit/haxe/lib/lime/2,9,1/lime/_backend/native/NativeWindow.hx:230: characters 16-33 : Unknown identifier : lime_window_get_y
C:/HaxeToolkit/haxe/lib/lime/2,9,1/lime/_backend/native/NativeRenderer.hx:122: characters 21-46 : Unknown identifier : lime_renderer_read_pixels
src/uk/co/mrsimonmorris/Main.hx:24: characters 9-23 : Class<lime.Assets> has no field getText
C:/HaxeToolkit/haxe/lib/lime/2,9,1/lime/app/Preloader.hx:25: characters 25-53 : Unknown<0> cannot be constructed
Build halted with errors.
If I comment out the macro call everything is fine. The macro is copied from the Haxe Manual. Any idea what’s going on here?