1

I'm trying to run a simple hello world script using the haxe language with hashlink and hlsdl on linux.

I've managed to squeeze out more errors from visual code, not just Failed to create window.

Could not start debugger on port 6112ERROR : TypeError: Cannot read property 'stop' of undefined

Called from /home/enchilada/.vscode/extensions/haxefoundation.haxe-hl-0.8.2/adapter.js line 6925 column 12
Called from /home/enchilada/.vscode/extensions/haxefoundation.haxe-hl-0.8.2/adapter.js line 411 column 12
Called from /home/enchilada/.vscode/extensions/haxefoundation.haxe-hl-0.8.2/adapter.js line 350 column 11
Called from events.js line 200 column 13
Called from internal/child_process.js line 1021 column 16
Called from internal/child_process.js line 430 column 11
Called from events.js line 200 column 13
Called from net.js line 586 column 12
Called from module.exports.loopWhile (/home/enchilada/.vscode/extensions/haxefoundation.haxe-hl-0.8.2/node_modules/deasync/index.js line 71 column 23)
Called from /home/enchilada/.vscode/extensions/haxefoundation.haxe-hl-0.8.2/adapter.js line 13907 column 27

The same errors gets printed with the newest 0.9.0 hashlink debugger version. When i run it from cmd it prints an error at window.hl.hx line 42 which is the following:

window = new sdl.Window(title, width, height);

At this line with a breakpoint height and width gets replaced with huge random numbers. Here is my full code which is just the sample from the heaps site:

import hxd.App;
import hxd.res.DefaultFont;

class Main extends App
{
    override function init(){       
        var tf = new h2d.Text(hxd.res.DefaultFont.get(), s2d);
        tf.text = "hello";
    }
    static function main() 
    {
        new Main();
    }

}

And here is the compile.hxml I run visual code with:

-lib heaps
-lib hlsdl
-hl hello.hl
-main Main

And the generated launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "HashLink (launch)",
            "request": "launch",
            "type": "hl",
            "hxml": "compile.hxml",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "args": "active configuration"
            }
        },
        {
            "name": "HashLink (attach)",
            "request": "attach",
            "port": 6112,
            "type": "hl",
            "hxml": "compile.hxml",
            "cwd": "${workspaceFolder}",
            "preLaunchTask": {
                "type": "haxe",
                "args": "active configuration"
            }
        },
        {
            "name": "Lime",
            "type": "lime",
            "request": "launch"
        }
    ]
}
Skarred
  • 21
  • 4
  • Hi Skarred, could you add your full script here? It's useful to have a MVE (https://stackoverflow.com/help/minimal-reproducible-example) to help find the root cause of the problem. It could also be useful to have the exact command you are using to run the script. – Brydenr Nov 26 '19 at 17:10
  • I know that I am a lifetime late, but did you try to run it directly with Haxe command rather than with the VSCode build command, usually gets easier to spot the error because less liable to config issues. The hxml you posted seems fine – vikkio Jul 08 '20 at 09:20

0 Answers0