digitalmars.D.learn - building a D app with multiple source files
- nikki (13/13) Aug 05 2014 Hello, I am completely new to D and have been paying around with
- Vladimir Panteleev (5/20) Aug 05 2014 What issues have you had with rdmd?
- nikki (17/21) Aug 05 2014 nikki@crunchbang:~/projects/d/artemisd$ rdmd example/source/app.d
- Vladimir Panteleev (4/28) Aug 05 2014 The search path does not include the artemisd package.
- Vladimir Panteleev (4/36) Aug 05 2014 Correction:
- nikki (2/4) Aug 05 2014 that one worked, woohoo thanks.
- Vladimir Panteleev (4/9) Aug 05 2014 You'll find it in dmd's --help. It adds the "source" directory to
- nikki (5/16) Aug 05 2014 edit: couldn't find that flag in dmd --help (only -Ipath),
- Mike Parker (10/26) Aug 05 2014 The switch itself is -I, not -Ipath. 'path' indicates a parameter for
- nikki (1/8) Aug 05 2014 aha! that would've bitten me in the future, now I get it, thanks.
- Gary Willoughby (5/8) Aug 05 2014 Remember rdmd is just a program to help collect and organise
- nikki (4/4) Aug 05 2014 edit : btw, I understand how to build an app that conscists out
- Vladimir Panteleev (5/9) Aug 05 2014 With rdmd, simply run `rdmd --build-only mainfile.d` (mainfile.d
- Gary Willoughby (13/17) Aug 05 2014 You can take a look at the dub build tool to automate all this
Hello, I am completely new to D and have been paying around with the tutorials, some docs and little test programs. Now I want to try and use https://github.com/elvisxzhou/artemisd for little gamedev experiment but I am running into build issues. That project doesn't have a Makefile in the repo, and I am on linux so I need to build it on the terminal, I've read about rdmd (and tried it without success) and found a few 'general' usage Makefiles, can't get any to just work when I type 'make all'. in the repo I linked to (artemisd) there are dozens of source files in various folders, and an example i have to compile at the same time I think. could someone show me how it's done ?
Aug 05 2014
On Tuesday, 5 August 2014 at 07:27:18 UTC, nikki wrote:Hello, I am completely new to D and have been paying around with the tutorials, some docs and little test programs. Now I want to try and use https://github.com/elvisxzhou/artemisd for little gamedev experiment but I am running into build issues. That project doesn't have a Makefile in the repo, and I am on linux so I need to build it on the terminal, I've read about rdmd (and tried it without success) and found a few 'general' usage Makefiles, can't get any to just work when I type 'make all'. in the repo I linked to (artemisd) there are dozens of source files in various folders, and an example i have to compile at the same time I think. could someone show me how it's done ?What issues have you had with rdmd? The library seems to have a package.json file, so you could also try dub: http://code.dlang.org/download
Aug 05 2014
What issues have you had with rdmd? The library seems to have a package.json file, so you could also try dub: http://code.dlang.org/downloadnikki crunchbang:~/projects/d/artemisd$ rdmd example/source/app.d example/source/app.d(5): Error: module all is in file 'artemisd/all.d' which cannot be read import path[0] = example/source import path[1] = /usr/include/dmd/phobos import path[2] = /usr/include/dmd/druntime/import Failed: ["dmd", "-v", "-o-", "example/source/app.d", "-Iexample/source"] nikki crunchbang:~/projects/d/artemisd$ rdmd --makedepend example/source/app.d example/source/app.d(5): Error: module all is in file 'artemisd/all.d' which cannot be read import path[0] = example/source import path[1] = /usr/include/dmd/phobos import path[2] = /usr/include/dmd/druntime/import Failed: ["dmd", "-v", "-o-", "example/source/app.d", "-Iexample/source"]
Aug 05 2014
On Tuesday, 5 August 2014 at 07:43:56 UTC, nikki wrote:The search path does not include the artemisd package. Try: cd .. && rdmd artemisd/example/source/app.d Or : rdmd -I.. example/source/app.dWhat issues have you had with rdmd? The library seems to have a package.json file, so you could also try dub: http://code.dlang.org/downloadnikki crunchbang:~/projects/d/artemisd$ rdmd example/source/app.d example/source/app.d(5): Error: module all is in file 'artemisd/all.d' which cannot be read import path[0] = example/source import path[1] = /usr/include/dmd/phobos import path[2] = /usr/include/dmd/druntime/import Failed: ["dmd", "-v", "-o-", "example/source/app.d", "-Iexample/source"] nikki crunchbang:~/projects/d/artemisd$ rdmd --makedepend example/source/app.d example/source/app.d(5): Error: module all is in file 'artemisd/all.d' which cannot be read import path[0] = example/source import path[1] = /usr/include/dmd/phobos import path[2] = /usr/include/dmd/druntime/import Failed: ["dmd", "-v", "-o-", "example/source/app.d", "-Iexample/source"]
Aug 05 2014
On Tuesday, 5 August 2014 at 07:46:05 UTC, Vladimir Panteleev wrote:On Tuesday, 5 August 2014 at 07:43:56 UTC, nikki wrote:Correction: rdmd -Isource example/source/app.dThe search path does not include the artemisd package. Try: cd .. && rdmd artemisd/example/source/app.d Or : rdmd -I.. example/source/app.dWhat issues have you had with rdmd? The library seems to have a package.json file, so you could also try dub: http://code.dlang.org/downloadnikki crunchbang:~/projects/d/artemisd$ rdmd example/source/app.d example/source/app.d(5): Error: module all is in file 'artemisd/all.d' which cannot be read import path[0] = example/source import path[1] = /usr/include/dmd/phobos import path[2] = /usr/include/dmd/druntime/import Failed: ["dmd", "-v", "-o-", "example/source/app.d", "-Iexample/source"] nikki crunchbang:~/projects/d/artemisd$ rdmd --makedepend example/source/app.d example/source/app.d(5): Error: module all is in file 'artemisd/all.d' which cannot be read import path[0] = example/source import path[1] = /usr/include/dmd/phobos import path[2] = /usr/include/dmd/druntime/import Failed: ["dmd", "-v", "-o-", "example/source/app.d", "-Iexample/source"]
Aug 05 2014
Correction: rdmd -Isource example/source/app.dthat one worked, woohoo thanks. what did the -Isource do? it's not in the 'rdmd --help'
Aug 05 2014
On Tuesday, 5 August 2014 at 07:51:53 UTC, nikki wrote:You'll find it in dmd's --help. It adds the "source" directory to the search path, the list of directories where the compiler looks for imported modules.Correction: rdmd -Isource example/source/app.dthat one worked, woohoo thanks. what did the -Isource do? it's not in the 'rdmd --help'
Aug 05 2014
On Tuesday, 5 August 2014 at 07:57:57 UTC, Vladimir Panteleev wrote:On Tuesday, 5 August 2014 at 07:51:53 UTC, nikki wrote:edit: couldn't find that flag in dmd --help (only -Ipath), atleast I know what it does now, hope I'll remember.. thanks a lot though great helpful communityYou'll find it in dmd's --help. It adds the "source" directory to the search path, the list of directories where the compiler looks for imported modules.Correction: rdmd -Isource example/source/app.dthat one worked, woohoo thanks. what did the -Isource do? it's not in the 'rdmd --help'
Aug 05 2014
On 8/5/2014 5:06 PM, nikki wrote:On Tuesday, 5 August 2014 at 07:57:57 UTC, Vladimir Panteleev wrote:The switch itself is -I, not -Ipath. 'path' indicates a parameter for which you need to substitute something, in this case a directory path. It should be the root folder for the source modules you want to add to the search path. In this case, for artemisd, the source files are in the 'source' directory, so -Isource is what you pass to dmd. If the directory were named 'foo' instead, you would pass -Ifoo. --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.comOn Tuesday, 5 August 2014 at 07:51:53 UTC, nikki wrote:edit: couldn't find that flag in dmd --help (only -Ipath), atleast I know what it does now, hope I'll remember.. thanks a lot though great helpful communityYou'll find it in dmd's --help. It adds the "source" directory to the search path, the list of directories where the compiler looks for imported modules.Correction: rdmd -Isource example/source/app.dthat one worked, woohoo thanks. what did the -Isource do? it's not in the 'rdmd --help'
Aug 05 2014
The switch itself is -I, not -Ipath. 'path' indicates a parameter for which you need to substitute something, in this case a directory path. It should be the root folder for the source modules you want to add to the search path. In this case, for artemisd, the source files are in the 'source' directory, so -Isource is what you pass to dmd. If the directory were named 'foo' instead, you would pass -Ifoo.aha! that would've bitten me in the future, now I get it, thanks.
Aug 05 2014
On Tuesday, 5 August 2014 at 08:06:57 UTC, nikki wrote:edit: couldn't find that flag in dmd --help (only -Ipath), atleast I know what it does now, hope I'll remember.. thanks a lot though great helpful communityRemember rdmd is just a program to help collect and organise parameters. It still passes everything to dmd. In fact if you use the --chatty option with rdmd it will show you everything it is doing including what it is passing to dmd.
Aug 05 2014
edit : btw, I understand how to build an app that conscists out of a few source files, I'd just do 'dmd file1.d file2.d' I amtalking here about the situation where that's unpractical because of the amount and folder structure.
Aug 05 2014
On Tuesday, 5 August 2014 at 07:29:46 UTC, nikki wrote:edit : btw, I understand how to build an app that conscists out of a few source files, I'd just do 'dmd file1.d file2.d' I amtalking here about the situation where that's unpractical because of the amount and folder structure.With rdmd, simply run `rdmd --build-only mainfile.d` (mainfile.d being the file that contains the "main" function). Omit --build-only to build the program to a temporary directory, then run it.
Aug 05 2014
On Tuesday, 5 August 2014 at 07:29:46 UTC, nikki wrote:edit : btw, I understand how to build an app that conscists out of a few source files, I'd just do 'dmd file1.d file2.d' I amtalking here about the situation where that's unpractical because of the amount and folder structure.You can take a look at the dub build tool to automate all this (as mentioned above). Dub works by compiling and linking everything together in your source folder. You specify the main entry point in a dub.json file. It's pretty easy to use and good for handling dependencies over the internet. To compile things manually you can use rdmd to automatically parse the files that need compiling. When using rdmd you only need to specify the file that contains the main function to build everything around it. for example: rdmd program.d This will pull in all imports inside program.d and compile and link them too.
Aug 05 2014