How minimal I can go using D on GDC?

Iain Buclaw ibuclaw at ubuntu.com
Sun May 12 08:19:19 PDT 2013


On 12 May 2013 15:41, Rel <relmail at rambler.ru> wrote:

> Benjamin Thaut, yes I know. but here is an example, if I add a class to
> the code like that:
>
>
> module main;
>
> extern (C) void* _Dmodule_ref = null;
> extern (C) void printf(const char*, ...);
>
> extern (C) void puts(const char*);
> extern (C) void exit(int);
>
> class A {
>         int a = 100;
>         int b = 200;
>
> };
>
> extern (C) void main() {
>         scope(exit) {
>                 puts("Exiting!");
>                 exit(0);
>         }
>
>         A a; printf("%d %d\n", a.a, a.b);
> }
>
> I would get a lot of undefined symbols like '_D14TypeInfo_Class6__vtblZ',
> '_**D6object6Object8toStringMFZAya**', '_D6object6Object6toHashMFZk' and
> etc. I don't really need any runtime type information, is there a way to
> make a compiler not generating typeinfos ('-fno-rtti' doesn't work)?
>

If you want to use classes, there must *always* be an Object class defined
somewhere to link to.  All classes derive from Object.

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20130512/2f565b73/attachment.html>


More information about the D.gnu mailing list