Giter VIP home page Giter VIP logo

Comments (9)

MikeWey avatar MikeWey commented on July 30, 2024

Assigning this in the constructor was always a bit of a hack. Looks like i'm forced to finally implement a proper solution.

from gtkd.

MikevanDongen avatar MikevanDongen commented on July 30, 2024

I didn't even know this = null; was legal. It does seem nice ;)

But I've been checking the history for that file and it used to just throw an exception. I don't see why someone got rid of that.

from gtkd.

MikeWey avatar MikeWey commented on July 30, 2024

The constructors get called from Gtkd functions which return those objects or null, so an exception would be cumbersome in those cases as it's perfectly valid for those functions to return null.

Also for Classes that are derived from ObjectG the constructor also reassigns this to a previously constructed object.

from gtkd.

MikevanDongen avatar MikevanDongen commented on July 30, 2024

I think thoses functions you were talking about should check if, e.g., the atkAction is NULL, so then it won't be the constructor's 'problem'.
What I'm saying is that I think the single responsibility principle should definitely be 'applied' in this situation.

from gtkd.

MikevanDongen avatar MikevanDongen commented on July 30, 2024

Here's an example of what I meant:
Action action = atkAction ? new Action(atkAction) : null;

I noticed you've removed quite some lines ;)
The directory gio still won't compile; can I help/assist you with anything?

from gtkd.

MikeWey avatar MikeWey commented on July 30, 2024

I think i've got all of them, i still heve to try compiling with 2.061 though.

from gtkd.

MikevanDongen avatar MikevanDongen commented on July 30, 2024

Well, GtkD compiles using the latest version of dmd/druntime/phobos. So that's great ;)
But when I include the library in an project of mine, upon linking it gives the following error:

/usr/local/lib/libgtkd-2.a(Loader.o): In function `_D4gtkc6Loader12pLoadLibraryFAyaE4gtkc6Loader4RTL--- errorlevel 1
DZPv':
src/gtkc/Loader.d:(.text._D4gtkc6Loader12pLoadLibraryFAyaE4gtkc6Loader4RTLDZPv+0x2f): undefined reference to `dlopen'
src/gtkc/Loader.d:(.text._D4gtkc6Loader12pLoadLibraryFAyaE4gtkc6Loader4RTLDZPv+0x38): undefined reference to `dlerror'
/usr/local/lib/libgtkd-2.a(Loader.o): In function `_D4gtkc6Loader10pGetSymbolFPvAyaZPv':
src/gtkc/Loader.d:(.text._D4gtkc6Loader10pGetSymbolFPvAyaZPv+0x2c): undefined reference to `dlsym'
src/gtkc/Loader.d:(.text._D4gtkc6Loader10pGetSymbolFPvAyaZPv+0x35): undefined reference to `dlerror'
/usr/local/lib/libgtkd-2.a(Loader.o): In function `_D4gtkc6Loader14pUnloadLibraryFPvZi':
src/gtkc/Loader.d:(.text._D4gtkc6Loader14pUnloadLibraryFPvZi+0x9): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status

Too be honest, I don't know what the cause of this could be.

Edit:
Is there a C-library of some kind I need to use?

    extern(C)
    {
        void* dlopen(char*, int);
        char* dlerror();
        void* dlsym(void*,char*);
        int   dlclose(void*);
    }

from gtkd.

MikeWey avatar MikeWey commented on July 30, 2024

Yes, you'll need libdl.

Add:

-L-ldl

to the dmd commandline.

from gtkd.

MikevanDongen avatar MikevanDongen commented on July 30, 2024

Thanks! It works :) 👍

from gtkd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.