Source:
Untar:
tar -xvzf libhdate-XXX.tar.gz
Configure:
cd libhdate-XXX
configure --prefix=/usr [--disable-hcal --disable-python
--disable-perl --disable-pascal]
--disable-hcal - do not build and install hcal/hdate utilities
--disable-python - do not build and install the python bindings
--disable-perl - do not build and install the perl bindings
--disable-pascal - do not build and install the pascal bindings
You will need swig and perl/python devel files.
Build:
make
Install:
make install (as root)
Debian packages (unstable):
libhdate debian packageUbuntu packages (dapper):
libhdate ubuntu packageMandriva packages (Ehad 2006):
libhdate mandriva packageWin32 (use with Visual Basic 6):
Contributed by Tomer Haimovich.
- Instsall msys on your Win32 system: http://www.mingw.org
- Compile and install libhdate using this config line:
configure --disable-nls
- Create a C wrapper file for the functions you need using this template:
/* Example code for libhdate with VB6 Author: Tomer Haimovich <tomer.ha __ gmail.com> */ #include "windows.h" #include "hdate.h" __declspec (dllexport) __stdcall DWORD getHoliday (DWORD d, DWORD m, DWORD y) { hdate_struct h; hdate_set_gdate(&h, d, m, y); return hdate_get_holyday(&h, FALSE); } __declspec (dllexport) BOOL __stdcall DllMain (HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { return TRUE; } - Create a def file describing the dll you built using this example:
LIBRARY hdatedll EXPORTS getHoliday
- Compile the wrapper file using this command example,
check for the currect library path on your system.
g++ -shared -o hdatedll.dll hdatedll.c -Wl,-add-stdcall-alias, --out-implib,libhdatedll_dll.a -Lc:/msys/1.0/lib -lhdate - Find the uniqe Alias names of you functions using the Dependency Walker tool, and use in your code like this:
Private Declare Function getHoliday Lib "hdatedll.dll" Alias "_Z10getHolidaymmm@12" (ByVal d As Long, ByVal m As Long, ByVal y As Long) As Long

