Using on Windows
In order to compile Windows projects with harud, you need:
- Dynamic library
libhpdf.dll
- Import library
libhpdf.lib
- D Binding
harud.lib
Get libhpdf.dll
You can download a pre-compiled build for 2.3.0RC2 version
here.
Create import library
The Basic Utilities Package from Digital
Mars (http://digitalmars.com/download/freecompiler.html) contains
the implib
tool that creates import library from dll:
implib /s libhpdf.lib libhpdf.dll
Get harud
You can download harud from here.
The directory lib
contains all libraries
Compiling with dub
In your dub file you should add references at import libraries.
For example:
{
"name": "hello",
"description": "Simple example with harud",
"libs-posix": ["hpdf"],
"sourcePaths": ["."],
"sourcePaths-windows": ["../../lib/"],
"sourceFiles-windows": ["../../lib/libhpdf.lib"],
"dependencies": {
"harud": ">=0.1.0"
}
}
sourcePaths-windows
refers to directory that contains libhpdf.lib
and sourceFiles-windows
refers directly to libhpdf.lib
.
Furthermore you should copy libhpdf.dll
in same directory of executable.
Compiling with make
Pass the libhpdf.lib
file to dmd when compiling your program:
dmd app.d ../harud/bin/harud.lib ../harud/lib/libhpdf.lib -I../harud/src -ofbin/hello.exe