Error: import `typename` is used as a type

Dfr deflexor at yandex.ru
Sun Dec 15 22:32:59 PST 2013


Hello, i struggling now to make my D program better organized.
As suggested here https://github.com/bioinfornatics/MakefileForD, 
i put all source files to src. Here is my current directory tree:

./
   Makefile
   src/
     main.d
     pcre/
       capi.d
       pcre_regex.d

Then i run make:

$ make
dmd -O -d -m32 -L-ldl -m32   -Isrc -c src/pcre/pcre_regex.d 
-ofbuild/src/pcre/pcre_regex.o
src/pcre/pcre_regex.d(79): Error: import pcre_regex.pcre is used 
as a type

What it could be ?

pcre is defined in pcre/capi.d as:

struct pcre {}

Then it is used in pcre_regex.d this way:

import pcre.capi;

class RegExp {
private pcre* _ppcre;  // <-- Error: import pcre_regex.pcre is 
used as a type
...
}





More information about the Digitalmars-d-learn mailing list