Using GtK

Mike Parker aldacron at gmail.com
Tue Aug 24 22:21:44 UTC 2021


On Tuesday, 24 August 2021 at 19:07:11 UTC, Ruby The Roobster 
wrote:

> Doing this, works though:
>
> dub add gtkd-3 at 3.9.0
> then
> dub fetch gtkd-3 at 3.9.0
> then dub test.d
>
> Will cause the program to run and execute.  However, it doesn't 
> save an executable to disk, which is what I want.  Is there a 
> way, to get it saved to disk?

There's nothing special you have to do. You should always see an 
executable after invoking dub for a run or build. But you've got 
some mixed-up commands here.

1. dub add requires a dub.json/sdl. I assume you have one, else 
the invocation would fail. But if you do, you aren't using it 
because of your invocation of `dub test.d` (see point 3 below).
2. dub fetch is not needed after dub add. If a dependency is 
added to your config file, dub will fetch it automatically.
3. dub test.d is for building a single file. To do that, you have 
to add your dub config in a comment at the top of the source file 
rather than as a separate dub.json/sdl. If you try to invoke dub 
with a source file name and there is no config at the top of the 
file, then the invocation will fail. And if you do have this, 
then your invocation of dub add isn't doing anything for you---it 
won't add dependencies to single-file configs.

If the first and last invocations really are succeeding, then it 
looks like you've got both a dub.json/sdl *and* a single-file 
config. And in that case, your dub.json/sdl isn't doing anything 
and dub is using the config at the top of test.d. And you should 
see an executable next to test.d after it completes.

So this is all rather confusing looking only at these command 
lines. How exactly have you configured this? What does test.d 
look like?






More information about the D.gnu mailing list