www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Is this rdmd bug or my fault ?

reply zabruk70 <sorry noem.ail> writes:
OS: Windows 7 (32 bit)
dmd: 2.069.2 and 2.070.0-b1

Then i used "-g" switch with RDMD, then i have OPTLINK error.
Reduced code, 3 modules, 2 of them in subdir:

moduleA.d
test\moduleB.d
test\moduleC.d

/////////////
module moduleA;

public void funcA () {
   import test.moduleB: funcB;
   return;
}

void main(string[] args) {
   return;
}

/////////////
module test.moduleB;

public void funcB () {
   import test.moduleC: funcC;
   funcC();

   return;
}

/////////////
module test.moduleC;

public void funcC () {
   return;
}

/////////////


C:\dmd2\windows\bin\rdmd.exe moduleA.d
//no errors, moduleA.exe created


C:\dmd2\windows\bin\rdmd.exe -g moduleA.d
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\Users\user\AppData\Local\Temp\.rdmd\rdmd-moduleA.d-D3D7676836384146D1D9D907CF20EC26\objs\moduleA.exe.obj(moduleA.exe)
  Error 42: Symbol Undefined _D4test7moduleC5funcCFZv
--- errorlevel 1

Problem disappear, then i move import in test.modileB to global 
level:

/////////////
module test.moduleB;

import test.moduleC: funcC;  //this works

public void funcB () {
   //import test.moduleC: funcC;  //this dont works
   funcC();

   return;
}
/////////////


Should i create bugreport, or this is my mistake?
Jan 08 2016
next sibling parent reply Tobi G. <gruen_tobias web.de> writes:
On Friday, 8 January 2016 at 15:45:52 UTC, zabruk70 wrote:
 Should i create bugreport, or this is my mistake?
I get also a compilation error (with rdmd and -g). Fortunately building manually with dmd works. So there has to be a bug in rdmd.. togrue
Jan 08 2016
parent reply zabruk70 <sorry noem.ail> writes:
On Friday, 8 January 2016 at 22:36:49 UTC, Tobi G. wrote:
On Saturday, 9 January 2016 at 01:43:57 UTC, Ivan Kazmenko wrote:
 I get also a compilation error (with rdmd and -g).
Thanks Tobi and Ivan. https://issues.dlang.org/show_bug.cgi?id=15533
Jan 09 2016
parent zabruk70 <sorry noem.ail> writes:
Can anybody explain:

Is dependencies file produced from command:
dmd -deps=moduleA.deps moduleA.d
must contains mention of moduleC?
Is dependencies file produced reccursively?

Thanks.
Jan 16 2016
prev sibling parent Ivan Kazmenko <gassa mail.ru> writes:
On Friday, 8 January 2016 at 15:45:52 UTC, zabruk70 wrote:
 Should i create bugreport, or this is my mistake?
Same here: rdmd moduleA.d works. rdmd -g moduleA.d produces a linker error. What's more: rdmd -m64 -g moduleA.d fails, and rdmd -m64 moduleA.d also fails. I have dmd 2.069.2 here. Older versions seem to behave the same. Please file a report at issues.dlang.org.
Jan 08 2016