www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15533] New: RDMD: -g switch produces linker error


          Issue ID: 15533
           Summary: RDMD: -g switch produces linker error
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: tools
          Assignee: nobody puremagic.com
          Reporter: golovanov_alexey mail.ru

Created attachment 1572
  --> https://issues.dlang.org/attachment.cgi?id=1572&action=edit
reduced test case (see moduleB import)

From forum: http://forum.dlang.org/thread/causshkknlxqlbqrbnkv forum.dlang.org
OS: Windows 7 (32 bit) DMD: 2.069.2 and 2.070.0-b1 RDMD: build 20160103 Problem: import inside function produced linker error then -g switch used. Test files in attach: 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; //import test.moduleC: funcC; //this works public void funcB () { import test.moduleC: funcC; //linker error 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; //linker error funcC(); return; } ///////////// --
Jan 09 2016