using wkhtmltopdf with D

Dr.No jckj33 at
Mon May 28 01:28:10 UTC 2018

I'm trying to use wkhtmltopdf[1] with D. I converted this 
header[2] with little modification using htod tool which resulted 
in this[3].
The libray is passed to link using:

pragma(lib, "wkhtmltox.lib");
(that file is in wkhtmltopdf\lib folder)

and the module imported with:
import pdf;

but it crashes right upon the start with a SEGFAULT:

void main()
	wkhtmltopdf_global_settings * gs;
	wkhtmltopdf_object_settings * os;
	wkhtmltopdf_converter * c;
	/* Init wkhtmltopdf in graphics less mode */

toolset I'm using:

DUB version 1.8.1, built on Apr 29 2018
LDC - the LLVM D compiler (1.9.0):
   based on DMD v2.079.1 and LLVM 5.0.1
   built with LDC - the LLVM D compiler (1.9.0)
   Default target: i686-pc-windows-msvc
   Host CPU: skylake -

What's likely the reason of the crash? mismatch between D and C 
memory alignment?


More information about the Digitalmars-d-learn mailing list