I have problems with compiling a very simple program which loads a couple of modules/functions (which I would like to use later on).

rdmd -I~/.dub/packages/consoled-1.0.0/source/  appX.d

runs great :-) and also dub runs works.

But dmd only returns:

´´´
$ dmd -I~/.dub/packages/consoled-1.0.0/source/  appX.d
appX.o:(.rodata+0x98): undefined reference to `_D8consoled12__ModuleInfoZ'
collect2: error: ld returned 1 exit status
--- errorlevel 1
´´´

What is going on here and what is the difference between dmd and rdmd?

Moreover, ldc2 has conflicts with modules which is probably due to installation, linking and scope issues. How can I shrink the scope for ldc2 such that it only looks at the "right place" for modules (and where is that?) ?

$ ldc2 -I~/.dub/packages/consoled-1.0.0/source/  appX.d
/usr/local/include/d/std/range.d(287): Error: module std.range from file /usr/local/include/d/std/range.d conflicts with package name range /usr/local/include/d/std/range.d(287): Error: module std.range from file /usr/local/include/d/std/range.d conflicts with package name range /usr/local/include/d/std/range.d(287): Error: module std.range from file /usr/local/include/d/std/range.d conflicts with package name range /usr/local/include/d/std/range.d(287): Error: module std.range from file /usr/local/include/d/std/range.d conflicts with package name range /usr/local/include/d/std/range.d(287): Error: module std.range from file /usr/local/include/d/std/range.d conflicts with package name range /usr/local/include/d/std/algorithm/iteration.d(59): Error: package name 'std.algorithm' conflicts with usage as a module name in file /usr/local/include/d/std/algorithm.d /usr/local/include/d/std/range.d(287): Error: module std.range from file /usr/local/include/d/std/range.d conflicts with package name range

In case it is of any interest my dummy code is:

´´´
import std.stdio;
import consoled; /* https://github.com/robik/ConsoleD */
import str = std.string;
import curl = std.net.curl;
import rx = std.regex;
import std.algorithm.iteration : splitter, joiner;
import std.algorithm : map;
import std.typecons;
import dt = std.datetime;
import ar = std.array;
import math = std.math : floor, ceil;
import std.conv : to;
import std.format : format;
import std.array;
import std.range.primitives;
import json = std.json;
import std.range : iota;


void main(string[] args)
{
writeln("==================\nNice it compiles and runs :-)\n==================");
}
´´´

I am working on Ubuntu 14.04 (64bit), with dmd 2.070, rdmd build 20160127 and ldc2 (installed from source without any extra flags) is based on DMD v2.068.2 and LLVM 3.6.0.



Reply via email to