Skip to content

Program exited with code -11 when using dagon:nuklear #89

@KrsKonst

Description

@KrsKonst

Hello, I'm trying to run a tutorial project from here. And I'm keep getting the "Program exited with code -11" error.
What I have for now:

project structure

<project root>
  assets
    fonts
      DroidSans.ttf
  source
    scenes
      MainMenu
        MainMenu.d
    app.d
//app.d

module main;

import dagon;
import scene;
import scenes.MainMenu;

class MyGame: Game
{
    this(uint windowWidth, uint windowHeight, bool fullscreen, string title, string[] args)
    {
        super(windowWidth, windowHeight, fullscreen, title, args);
        currentScene = New!MainMenu(this);
    }
}

void main(string[] args)
{
    MyGame game = New!MyGame(1280, 720, false, "Dagon test", args);
    game.run();
    Delete(game);
}
//scenes/MainMenu/MainMenu.d

module scenes.MainMenu;

import dagon;
import dagon.ext.nuklear;
import dagon.ext.ftfont;

class MainMenu: Scene {
    Game game;
    FontAsset font;
    NuklearGUI ui;
    Entity uiEntity;

    this(Game game){
        super(game);
        this.game = game;
    }

    override void beforeLoad(){
        font = this.addFontAsset("assets/fonts/DroidSans.ttf", 18);
    }

    override void afterLoad(){
        ui = New!NuklearGUI(eventManager, assetManager);
        ui.addFont(font, 18, ui.localeGlyphRanges);

        uiEntity = addEntityHUD();
        uiEntity.drawable = ui;
        uiEntity.visible = true;

        eventManager.showCursor(true);
    }

    override void onUpdate(Time time){
        if(uiEntity.visible){
            ui.update(time);
            layout();
        }
    }

    void layout(){
        /** TODO: ui elements **/
    }
}

dub.json

{
	"authors": [
		""
	],
	"dependencies": {
		"dagon": "~>0.14.1",
		"dagon:ftfont": "~>0.14.1",
		"dagon:nuklear": "~>0.14.1"
	},
	"license": "proprietary",
	"name": "untitledspacegame",
	"targetName": "Untitled_space_game"
}

/usr/local/lib
(Nuklear libraries are installed as mentioned in readme)

libnuklear.so        libpng12.a   libpng12.so.0       libpng.la    libpng.so.3.54.0  python2.7
libnuklear.so.4.2.5  libpng12.la  libpng12.so.0.54.0  libpng.so    node_modules      python3.10
libnuklear_static.a  libpng12.so  libpng.a            libpng.so.3  pkgconfig         python3.8

unit tests for dagon:nuklear are fine

Building package dagon:nuklear in /home/sinister/.dub/packages/dagon-0.14.1/dagon/extensions/nuklear/
             Generating test runner configuration 'dagon-nuklear-test-library' for 'library' (library).
    Starting Performing "unittest" build using /usr/bin/dmd for x86_64.
    Building dlib 1.0.0: building configuration [library]
    Building dagon 0.14.1: building configuration [library]
    Building dagon:ftfont 0.14.1: building configuration [library]
    Building dagon:nuklear 0.14.1: building configuration [dagon-nuklear-test-library]
     Linking dagon-nuklear-test-library
             Copying files for dagon...
     Running ../../../../../.dub/packages/dagon-0.14.1/dagon/extensions/nuklear/dagon-nuklear-test-library 
All unit tests have been run successfully.

dub run --build-mode separate --force

Starting Performing "debug" build using /usr/bin/dmd for x86_64.
    Building dlib 1.0.0: building configuration [library]
    Building dagon 0.14.1: building configuration [library]
    Building dagon:ftfont 0.14.1: building configuration [library]
    Building dagon:nuklear 0.14.1: building configuration [library]
    Building untitledspacegame ~master: building configuration [application]
     Linking Untitled_space_game
             Copying files for dagon...
     Running Untitled_space_game 
Warning: no "settings.conf" found
Warning: no "input.conf" found
Error Program exited with code -11

I've also tried to change dub.json that way, so it would be more like that

{
	"authors": [
		""
	],
	"dependencies": {
		"dagon": "~master",
		"dagon:ftfont": "~master",
		"dagon:nuklear": "~master"
	},
	"license": "proprietary",
	"name": "untitledspacegame",
	"targetName": "Untitled_space_game"
}

but I'm getting the same error

Warning WARNING: A deprecated branch based version specification is used for the dependency dagon:nuklear. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
     Warning WARNING: A deprecated branch based version specification is used for the dependency dagon. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
     Warning WARNING: A deprecated branch based version specification is used for the dependency dagon:ftfont. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
    Starting Performing "debug" build using /usr/bin/dmd for x86_64.
    Building dlib 1.1.0: building configuration [library]
    Building dagon ~master: building configuration [library]
    Building dagon:ftfont ~master: building configuration [library]
    Building dagon:nuklear ~master: building configuration [library]
    Building untitledspacegame ~master: building configuration [application]
     Linking Untitled_space_game
             Copying files for dagon...
     Running Untitled_space_game 
Warning: no "settings.conf" found
Warning: no "input.conf" found
Error Program exited with code -11

System: 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
dmd --version: DMD64 D Compiler v2.101.1

Thanks in advance for reply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    external bugA bug in an external dependency

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions