www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2106] New: export class doesn't affect, what is exported

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2106

           Summary: export class doesn't affect, what is exported
           Product: D
           Version: 2.013
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: link-failure, spec
          Severity: major
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: the.yossarian gmail.com


the export modifier on class doesn't work as excepted.

export class A { export public void function(); }
export class B : A { public void function2(); }

this code exports ONLY A.function(); ( i checked DLL with objdump )

the following throws undefined error when linking:

B b = new B();
A a = cast(A)b;

Error 42: Symbol Undefined _D4test1A1A7__ClassZ
.....


-- 
May 14 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2106


torhu yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |torhu yahoo.com






 the export modifier on class doesn't work as excepted.
 
 export class A { export public void function(); }
 export class B : A { public void function2(); }
 
 this code exports ONLY A.function(); ( i checked DLL with objdump )
I haven't tried getting classes inside DLLs to work myself. But you should probably provide a complete, compilable, minimal test case.
 
 the following throws undefined error when linking:
 
 B b = new B();
 A a = cast(A)b;
Do you need both lines to trigger the error, isn't the first one enough? --
May 14 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2106






ok, the first is enough.
test case:


--- dll.d ---
module dll;

export class A 
{ 
        export void func() { }
}

--- test.d ---
import dll;

int main()
{
        A a = new A();
        return 0;
}

--- make.bat ---
dmd -ofdll.dll dll.d phobos.lib
dmd -oftest.exe test.d phobos.lib

dies with:
test.obj(test)
 Error 42: Symbol Undefined _D3dll1A7__ClassZ


-- 
May 14 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2106


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|spec                        |



01:40:12 PST ---
The problem is an export record isn't generated for the _ClassZ. It's a
compiler bug, not a spec issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2106




Commit pushed to https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/34d31ba9e6267ac97cc8081ac4729076e4ca7bc5
fix Issue 2106 - export class doesn't affect, what is exported

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2106




Commit pushed to https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/2b627769522256f983b0fadca1e964752c6a2909
fix Issue 2106 - export class doesn't affect, what is exported

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2106


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012