Giter Club home page Giter Club logo

Comments (8)

growlercab avatar growlercab commented on June 4, 2024

I might be all wrong about this because you're clearly building on this branch. Maybe my dub is out of date (it's Feb 17 2015)?

If so feel free to close this and I'll figure out what I'm doing wrong.

from dgame.

Dgame avatar Dgame commented on June 4, 2024

Currently, I'm using the test directory only, so it could be my fault. I will change it to 'library'.

from dgame.

Dgame avatar Dgame commented on June 4, 2024

I believe 'library' could bring some trouble since Dgame isn't like other DUB packages; there is no src/Dgame path. If 'sourceLibrary' works better than 'library, I have to change the structure to src/Dgame.

from dgame.

growlercab avatar growlercab commented on June 4, 2024

Thanks, I'll give it a try.

I think sourceLibrary should work OK because you have "sourcePaths":["."] in your dub.json.

from dgame.

growlercab avatar growlercab commented on June 4, 2024

OK, the dub.json bug is now fixed but as a library target it fails because it picks up main() in test/main.d and I get this error.

../../../../.dub/packages/dgame-0.5.0/test/main.d(35): Error: only one main allowed

The fix is trivial and requires changing the "excludedSourceFiles" field in the "lib" target to:

"excludedSourceFiles": ["main.d", "test/main.d"].

Whenever you around to this is cool, 0.5.0 is WIP after all.

from dgame.

Dgame avatar Dgame commented on June 4, 2024

After tomorrow I have plenty of time. ;) But I will fix this small bug in the next hour.
How do you import Dgame if you build it as a library?

from dgame.

growlercab avatar growlercab commented on June 4, 2024

Ah, sorry my bad. When I look now I see that I had Dgame building as a sourceLibrary.

WIth the last commit and Dgame targetType as sourceLibrary I can compile and run the "tut.d" as a completely separate dub project.
(I get a run time error from Derelict about invalid fonts but that is unrelated to this issue)

Build with Dgame as a "library" target I get the import path error:

source/testdgame.d(4): Error: module Window is in file 'Dgame/Window/Window.d' which cannot be read

Sorry for the confusion. I'll also look into dub and how to get Dgame prefix to import paths for a library target. If I stumble across anything I'll let you know .

from dgame.

Dgame avatar Dgame commented on June 4, 2024

The whole test folder will disappear, so it's only a temporal fix. ;) Don't worry.

source/testdgame.d(4): Error: module Window is in file 'Dgame/Window/Window.d' which cannot be read

It's because Dgame is not built like DUB wants to. Maybe I should change it to 'source/Dgame'. DUB will automatically accept source as import path and the error should disappear.

from dgame.

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.