problem using ldc 1.0.0 as D compiler
Antonio Corbi via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jun 20 04:28:58 PDT 2016
Hi folks!
I'm using ldc version:
LDC - the LLVM D compiler (1.0.0):
based on DMD v2.070.2 and LLVM 3.8.0
built with DMD64 D Compiler v2.071.0
Default target: x86_64-unknown-linux-gnu
Host CPU: core2
And when trying to run this code (it compiles ok):
import std.regex;
void main(string[] args) {
processLine ("abc int char[]");
}
long processLine (string l) {
long count;
int[string] lpb;
lpb = ["char" : 0, "int" : 0, "for" : 0];
foreach (rw; lpb.byKey) {
string re = r"(^|\W)" ~ rw ~ r"(\W|$)";
count = 0;
auto r = matchAll(l, re);
foreach(c; r) count++;
lpb[rw] += count;
}
return count;
}
I get this error:
./ldcfail
Fatal Error while loading '/usr/lib/libphobos2-ldc.so.70':
The module 'std.regex.internal.parser' is already defined
in './ldcfail'.
The same code compiles and executes ok with both dmd (DMD64 D
Compiler v2.071.0) and gdc (gdc (GCC) 6.1.1 20160501).
Is this a bug in ldc or is it somehow related to my code?
Thanks for your help.
More information about the Digitalmars-d
mailing list