www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: DMC to Create C .lib ?

reply Chris Andrews <CodexArcanum gmail.com> writes:
Sergey Gromov Wrote:

 "Want to create an import library? Ask me how!"

Well since you offered... ;) I tried out coffimplib, but it's not yeilding the results I need. I compared the linkdef generated .def files with coffimplib's and the missing part is pretty clear: linkdef: EXPORTS _TCOD_console_flush 0 = TCOD_console_flush _TCOD_console_init_root 16 = TCOD_console_init_root coffimplib: EXPORTS _TCOD_console_flush = TCOD_console_flush _TCOD_console_init_root = TCOD_console_init_root Those missing numbers (something to do with the size of the parameters, right?) are needed and not being provided by the tool. Thoughts?
Mar 24 2009
parent Sergey Gromov <snake.scaly gmail.com> writes:
Tue, 24 Mar 2009 22:31:52 -0400, Chris Andrews wrote:

 Sergey Gromov Wrote:
 
 "Want to create an import library? Ask me how!"

Well since you offered... ;) I tried out coffimplib, but it's not yeilding the results I need. I compared the linkdef generated .def files with coffimplib's and the missing part is pretty clear: linkdef: EXPORTS _TCOD_console_flush 0 = TCOD_console_flush _TCOD_console_init_root 16 = TCOD_console_init_root coffimplib: EXPORTS _TCOD_console_flush = TCOD_console_flush _TCOD_console_init_root = TCOD_console_init_root Those missing numbers (something to do with the size of the parameters, right?) are needed and not being provided by the tool. Thoughts?

You're talking about Doryen Library project, right? My thought is that TCOD_console_flush is actually cdecl and must be declared as extern(C), while you seem to declare it as extern(Windows) which is stdcall. What you get with linkdef is corrupted stack. This is why coffimplib is absolute best when you have the right COFF import library: it allows to catch this sort of errors.
Mar 25 2009