www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How do I use dub?

reply "Minas Mina" <minas_mina1990 hotmail.co.uk> writes:
I intent to use D to make a small 2D game.
I have downloaded eclipse, DDT plugin and dub. I also set the 
path to dub in eclipse.

So I made a new project, tested a writeln and it worked. The next 
step was to add some dependencies for derelict. I need SFML for 
now (and DerelictUtils of course).

So this is what I've done:

{
	"name" : "DTest",
	"description" : "A minimal D bundle.",
	"dependencies" : {
		
		"derelict-util": ">=1.0.3",
		"derelict-sfml2": "~2.1"
	},
	
	"versions-x86_64": ["UseAmd64Impl"],
	"lflags": ["-I/home/minas/.dub/packages/derelict-sfml2-2.1/lib", 
"-LDerelictSFML2"]
}


The way I specified the library seems very ugly to me. 
Essentially it's a full path... How can I tell dub to use it by 
locating it automatically from its local repository?
Oct 24 2014
next sibling parent reply "Minas Mina" <minas_mina1990 hotmail.co.uk> writes:
Oh and another thing: The program compiles right now but I can't 
execute it because for some reason:
Failed to create a child process.
Cannot run program 
"/home/minas/Projects/eclipse_workspace/DTest/dtest" (in 
directory "/home/minas/Projects/eclipse_workspace/DTest"): 
error=13, Permission denied

Running from terminal yields the same error.
Oct 24 2014
parent "Mike Parker" <aldacron gmail.com> writes:
On Friday, 24 October 2014 at 23:50:26 UTC, Minas Mina wrote:
 Oh and another thing: The program compiles right now but I 
 can't execute it because for some reason:
 Failed to create a child process.
 Cannot run program 
 "/home/minas/Projects/eclipse_workspace/DTest/dtest" (in 
 directory "/home/minas/Projects/eclipse_workspace/DTest"): 
 error=13, Permission denied

 Running from terminal yields the same error.
That's a file permissions problem. Make sure that you have write access to that directory.
Oct 24 2014
prev sibling parent "Mike Parker" <aldacron gmail.com> writes:
On Friday, 24 October 2014 at 23:46:51 UTC, Minas Mina wrote:

 The way I specified the library seems very ugly to me. 
 Essentially it's a full path... How can I tell dub to use it by 
 locating it automatically from its local repository?
You don't. That's what dub does by default.
Oct 24 2014