On Saturday, 22 October 2016 at 03:59:16 UTC, Jason C. Wells
wrote:
nanovg_demo>dmd example.d iv\arsd\color.d
iv\arsd\simpledisplay.d iv\perf.d
iv\perf.d(41): Error: module iv.nanovg.nanovg from file
iv\nanovg.d must be
imported with 'import iv.nanovg.nanovg;'
demo.d(6): Error: module iv.nanovg.nanovg from file
iv\nanovg.d must be
imported with 'import iv.nanovg.nanovg;'
iv/nanovg/nanovg does not exist in the source code zip files.
(I was reluctant to duplicate nanonvg into iv\nanovg because
somewhere I learned that copy-pasting code is a bad idea.)
it's way easier, actually. first, you don't have to place files
into correct directories if you are passing all of them (files)
as arguments to dmd. they don't even have to have correct names.
"correct" file placement is required only if dmd should search
for modules on his own.
second: you simply didn't pass all the required modules. perf.d
depends on core nanovg engine, but you didn't passed that to dmd.
the easiest way is just pall *all* *.d files you have to dmd.
don't try to be picky ;-), dmd is fast enougth that you can
safely pass alot of sources to it. and there is no harm in
providing dmd with "extra" modules.
as for "correct" placement (if you want it), it should be like
that:
dmd -Imodroot main.d
main.d is your main D file, modroot is dir where all modules will
be. it should be like that:
modroot/arsd/color.d
modroot/arsd/<other Adam's modules here>
modroot/iv/nanovg/nanovg.d
modroot/iv/nanovg/<other NanoVG files here, keeping subdirs>
also, pref.d module is completely unnecessary, it is just utility
thingy to show FPS counter. ;-)
p.s. you will also need stb_ttf port, arsd repo has it under the
name "ttf.d".
p.p.s. the easiest way to do everything is this:
mkdir modroot
cd modroot
git clone git://repo.or.cz/iv.d.git iv
git clone https://github.com/adamdruppe/arsd.git arsd
cd ..
rdmd -Imodroot main.d
;-)