digitalmars.D - Simple program fails to link - what am I doing wrong?
- Mike Hearn (22/22) Nov 12 2009 I have a feeling this is a real simple problem. What does _D4test7MyClas...
- Denis Koroskin (3/28) Nov 12 2009 Function MyClass.b is not implemented (but is referenced, because it is ...
- Denis Koroskin (2/27) Nov 12 2009 BTW, questions like this belong to D.learn
- Mike Hearn (2/4) Nov 12 2009 Oh, duh, of course. Thanks. Would be nice to teach ld how to demangle D ...
I have a feeling this is a real simple problem. What does _D4test7MyClass1bMFZv demangle to? class MyClass { int a; void b(); } int main() { MyClass c; return 0; } $ dmd -v -run test.d parse test importall test import object (/home/hearn/d/dmd2/linux/bin/../../src/druntime/import/object.di) semantic test semantic2 test semantic3 test code test function main gcc test.o -o test -m32 -Xlinker -L/home/hearn/d/dmd2/linux/bin/../lib -lphobos2 -lpthread -lm test.o:(.rodata+0x34): undefined reference to `_D4test7MyClass1bMFZv' collect2: ld returned 1 exit status --- errorlevel 1
Nov 12 2009
On Thu, 12 Nov 2009 20:22:56 +0300, Mike Hearn <mike plan99.net> wrote:I have a feeling this is a real simple problem. What does _D4test7MyClass1bMFZv demangle to? class MyClass { int a; void b(); } int main() { MyClass c; return 0; } $ dmd -v -run test.d parse test importall test import object (/home/hearn/d/dmd2/linux/bin/../../src/druntime/import/object.di) semantic test semantic2 test semantic3 test code test function main gcc test.o -o test -m32 -Xlinker -L/home/hearn/d/dmd2/linux/bin/../lib -lphobos2 -lpthread -lm test.o:(.rodata+0x34): undefined reference to `_D4test7MyClass1bMFZv' collect2: ld returned 1 exit status --- errorlevel 1Function MyClass.b is not implemented (but is referenced, because it is put into a virtual function table).
Nov 12 2009
On Thu, 12 Nov 2009 20:22:56 +0300, Mike Hearn <mike plan99.net> wrote:I have a feeling this is a real simple problem. What does _D4test7MyClass1bMFZv demangle to? class MyClass { int a; void b(); } int main() { MyClass c; return 0; } $ dmd -v -run test.d parse test importall test import object (/home/hearn/d/dmd2/linux/bin/../../src/druntime/import/object.di) semantic test semantic2 test semantic3 test code test function main gcc test.o -o test -m32 -Xlinker -L/home/hearn/d/dmd2/linux/bin/../lib -lphobos2 -lpthread -lm test.o:(.rodata+0x34): undefined reference to `_D4test7MyClass1bMFZv' collect2: ld returned 1 exit status --- errorlevel 1BTW, questions like this belong to D.learn
Nov 12 2009
Denis Koroskin Wrote:Function MyClass.b is not implemented (but is referenced, because it is put into a virtual function table).Oh, duh, of course. Thanks. Would be nice to teach ld how to demangle D names.
Nov 12 2009