using dll in am

From: David Hoksza <david(dot)hoksza(at)seznam(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: using dll in am
Date: 2006-04-23 15:48:31
Message-ID: 737961084.20060423174831@seznam.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, I'm trying to implement my own access method, which uses c++
framework for saving tuples. The framework consists of set of
functions, which are implemented in win32 dll.
All the functions which are desired by PG (ambuild, aminsert, ...) are
implemented and functional. But when I want to use any of the
functions from dll so there's problem when loading the dll in
dynloader. It says that function can't be found (in the time of
loading the dll).
I do following steps:

1. Compiling the dll in Microsoft Visual Studio.
2. Creating the def file (in mingw32):

impdef rtreewrapper.def rtreewrapper.dll

which yealds in the folowing def file:

LIBRARY RTREEWRAPPER.DLL

EXPORTS
f_cRTreeItem_GetSize = _f_cRTreeItem_GetSize(at)4
f_cRTreeLeafItem_GetSize = _f_cRTreeLeafItem_GetSize(at)4
f_cRTreeLeafItem_size = _f_cRTreeLeafItem_size(at)0
f_header = _f_header(at)0
f_header_ComputeNodeSize = _f_header_ComputeNodeSize(at)4
f_header_CreateSpaceDescriptor= _f_header_CreateSpaceDescriptor(at)12
f_header_GetSpaceDescriptor_GetDimension= _f_header_GetSpaceDescriptor_GetDimension(at)4
f_header_GetSpaceDescriptor_SetBitSize= _f_header_GetSpaceDescriptor_SetBitSize(at)12
f_header_SetLeafNodeItemSize = _f_header_SetLeafNodeItemSize(at)8
f_header_SetNodeItemSize = _f_header_SetNodeItemSize(at)8
f_leafitem1 = _f_leafitem1(at)0
f_leafitem = _f_leafitem(at)4
f_leafitem_GetTuple_GetValue_GenerateRandom= _f_leafitem_GetTuple_GetValue_GenerateRandom(at)8
f_leafitem_Resize = _f_leafitem_Resize(at)8
f_timer = _f_timer(at)0
f_timer_Print = _f_timer_Print(at)8
f_timer_Start = _f_timer_Start(at)4
f_timer_Stop = _f_timer_Stop(at)4
f_tree = _f_tree(at)4
f_tree_Close = _f_tree_Close(at)4
f_tree_Create = _f_tree_Create(at)16
f_tree_Find = _f_tree_Find(at)8
f_tree_GetQueryStatistics_GetCounter_GetValue= _f_tree_GetQueryStatistics_GetCounter_GetValue(at)4
f_tree_GetQueryStatistics_GetCounter_Reset= _f_tree_GetQueryStatistics_GetCounter_Reset(at)4
f_tree_Insert = _f_tree_Insert(at)8
f_tree_PrintInfo = _f_tree_PrintInfo(at)4

3. Creating the .a file from dll by using:

dlltool --dllname rtreewrapper.dll --def rtreewrapper.def --output-lib rtreewrapper.a

4. Compiling the whole AM module with makefile containing following line:

OBJS = atomrtget.o atomrtree.o atomrtscan.o atomrtcostestimate.o rtreewrapper.a

5. Copy the dll to the bin directory (when I let it in the contrib
directory, where also the libatomrtree.dll file with the AM functions
is, so it writes out, that the modul can't be found, when loading it).

6. When there is "void *header = f_header()" anywhere in the source,
so when trying to load the dll (when I try to create the index), it
writes out, that "function can't be found" (I got czech version, so I'm
not sure, what the message is in english).

Does anybody got any hint, where the problem could be? I really can't
find it:((

Thanks.

David Hoksza

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2006-04-23 15:55:40 Re: TODO items..
Previous Message Alvaro Herrera 2006-04-23 15:42:10 Re: TODO items..