On 03.01.2016 14:12, anonymous wrote:
You shouldn't get a segfault, though. You should get some compile/link
error. Are you compiling the right files? Can the segfault be from
something other than your program?
Oh, I see what's probably happening:
You compile the D program, but you don't compile and/or don't link the C
object file. It segfaults then when trying to call the C function.
You need to compile the C file and pass it to dmd or the linker. For
example:
gcc -c -otest.c.o test.c
dmd test.d test.c.o
./test