D - function call from assembly
- Manfred Hansen (39/39) Mar 05 2004 Hello
- Ben Hinkle (6/6) Mar 05 2004 My only suggestion is add "extern (C)"
- Manfred Hansen (6/13) Mar 05 2004 It looks good.
Hello i try to call a function from an assembly program. .section .data .section .text .globl _start _start: call prin The D programm void prin() { /* printf("Hallo"); */ int i = 3; } Compile with: dmd -c print.c gcc -s -c d_function.s gcc -nostdlib d_function.o print.o -lgcc -o d_function c_function.o(.text+0x1): In function `_start': : undefined reference to `prin' collect2: ld returned 1 exit status Maybe someone have an idea, or a better example. Manfred
Mar 05 2004
My only suggestion is add "extern (C)" extern (C) void prin() { /* printf("Hallo"); */ int i = 3; }
Mar 05 2004
Ben Hinkle wrote:My only suggestion is add "extern (C)" extern (C) void prin() { /* printf("Hallo"); */ int i = 3; }It looks good. There are no error message anymore. In the evening or tommorow i will try this in my real proramm. Thank you. Manfred
Mar 05 2004