D - DMD 0.79 bug: Externs not working.
- Burton Radons (35/35) Jan 26 2004 This requires three files. Here is "impl.d":
- Walter (1/1) Jan 27 2004 Does it work if they are all compiled with separate dmd commands?
- Burton Radons (6/7) Jan 27 2004 After the amendment, no (I don't think it would link with the first
- Burton Radons (6/49) Jan 27 2004 This process isn't quite right. They should be:
This requires three files. Here is "impl.d": module stub; class Class { this () { Method (); } void Method () { printf ("Hello, world!\n"); } } Here is "stub.d": module stub; class Class { this (); void Method (); } So "impl.d" contains the implementation while "stub.d" contains just the stub. Here is "user.d": import stub; class Inheritor : Class { this () { super (); } } void main () { new Inheritor; } The compilation process is like this: dmd -c impl.d dmd impl.obj stub.d user.d test.exe test.exe This causes an Access Violation right inside the Method call. It should and has historically worked. I don't know what version it was introduced into DMD, likely in the 0.7* series.
Jan 26 2004
Does it work if they are all compiled with separate dmd commands?
Jan 27 2004
Walter wrote:Does it work if they are all compiled with separate dmd commands?After the amendment, no (I don't think it would link with the first version of the commands). It looks like incorrect sub-classing is what's generating the problem as I can instantiate a Class from "user.d" directly without a problem (by adding "new Class;" to the beginning of "main()"); it's only once I try my own sub-class that it fails.
Jan 27 2004
Burton Radons wrote:This requires three files. Here is "impl.d": module stub; class Class { this () { Method (); } void Method () { printf ("Hello, world!\n"); } } Here is "stub.d": module stub; class Class { this (); void Method (); } So "impl.d" contains the implementation while "stub.d" contains just the stub. Here is "user.d": import stub; class Inheritor : Class { this () { super (); } } void main () { new Inheritor; } The compilation process is like this: dmd -c impl.d dmd impl.obj stub.d user.d test.exe test.exeThis process isn't quite right. They should be: dmd -c impl.d dmd impl.obj user.d test.exe test.exe "stub.d" was removed from the second line.
Jan 27 2004