On Saturday, 24 September 2016 at 06:05:11 UTC, Mike Parker wrote:
On Saturday, 24 September 2016 at 02:33:22 UTC, WhatMeWorry wrote:


I see that dub has all the .d import files already placed in
C:\Users\Me\AppData\Roaming\dub\packages\derelict-gl3-1.0.19\derelict-gl3\source\derelict\opengl3

and C:\Users\Me\AppData\Roaming\dub\packages\derelict-glfw3-3.1.0\derelict-glfw3\source\derelict\glfw3

which should have all the definitions. Is their an elegant way that I can tell dub to where these definitions? Or do I just have to brute force all the -I paths?

You don't have to specify the paths of dependencies. dub knows where they are and will make sure the compiler knows, too.


I assume there is a slick way of specifying this because what happens when say glfw3-3.1.0 gets bumped up to 3.1.1?

Then you execute 'dub upgrade' in the directory where your dub configuration resides. As long as you have the version of each dependency specified properly, it will do the right thing (TIP: use ~>x.x.x for versions, rather than >=x.x.x -- the former will restrict you to patch-level upgrades, e.g. 3.1.0 -> 3.1.1 and never 3.2, while the latter would happily go from 3.x -> 4.0 if it's available, often a breaking change).

Did you import the derelict modules you're using in your app.d?

Well, my dub.sdl file has:

dependency "derelict-gl3" version="~>1.0.19"
dependency "derelict-glfw3" version="~>3.1.0"

My app.d has:

module app;
import common.derelict_libraries;

and derelict_libraries.d has:

module derelict_libraries;
import derelict.glfw3.glfw3;
import derelict.opengl3.gl3;


It's fine to import other imports, Right?

I am trying to make a portable dub/dmd build environment on a flash drive for PC So the dub project is currently on a flash drive that is assigned the letter E: Naturally, this could change if the flash drive were moved to another PC. did have to write a little shim code to add environment["DFLAGS"] = r"-I..\"; so that the app.d import could find the derelict_libraries.d relative to the project directory. Like so:

E:\projects\01_01_hello_window
E:\projects\01_01_hello_window\source\app.d
E:\projects\common\derelict_libraries.d


So to summarize things, the derelict imports are fine.

But how does dub tell dmd that it should looking for opengl imports at:

C:\Users\Kyle\AppData\Roaming\dub\packages\derelict-gl3-1.0.15\source\derelict\opengl3

and glfw3's imports at:

C:\Users\Kyle\AppData\Roaming\dub\packages\derelict-glfw3-3.1.0\derelict-glfw3\source\derelict\glfw3

I'm desperately trying to avoid hard coding these paths. Because I want to use a lot more dub packages in the future.



Reply via email to