In reply to saketa:
Sorry this was my mistake. The compile command is vlog sine.sv dpi_sin.c -dpiheader sin.h