From: Roger K. W. <ROG...@sa...> - 2003-01-27 15:48:15
|
Jiri Krivanek wrote: >Gents, > >Just imagine the elementary example: > >I have the third party DLL. Named say KK.DLL. I know that it contains >only one export function named say Mul. And I have the C language >header which exactly defines the function prototype: > >#ifndef KKH >#define KKH > >extern int Mul(int a, int b); > >#endif // KKH > >Thats all. I do not have any libraries. I do not have the source >codes of the DLL. > >The question is: > >How can I call the Mul() export of the KK.DLL? Please, do not advice >me to use the LoadLibrary() and the GetProcAddress() Windows APIs. >There must be some other possibility. > > > > >Background: > >Now I have all headers required for the GDI+ development. It compiles >with no problem (it is taken from the MS Platform SDKs and slightly >refined for G++). And I have the gdiplus.dll. The problem is that I >am unable to create the connection between headers and DLL. In other >words it does not link. > >In Delphi I used to simply declare the function header (relates to >the above mentioned elementary example): > >function Mul(a, b: integer): integer; external 'KK.DLL'; > > >Thanks, > >Kk. Ing. Jiri Krivanek > Realtime applications programmer > Beta Control s.r.o. > Cerneho 58/60 > 635 00 BRNO-Bystrc > CZECH REPUBLIC > tel.: +420 5 46 22 34 91 - 36 > email 1: JiriKrivanek@BetaControl.cz > > > >------------------------------------------------------- >This SF.NET email is sponsored by: >SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! >http://www.vasoftware.com >_______________________________________________ >MinGW-users mailing list >Min...@li... > >You may change your MinGW Account Options or unsubscribe at: >https://lists.sourceforge.net/lists/listinfo/mingw-users > > > > Assuming that you are using GCC 3.2 you can just supply kk.dll to ld at link time. Usually I name my dll's like libkk.dll in the *nix style.. Then the following works: gcc -omain main.c -lkk hope this helps -- Roger Wells, P.E. SAIC 221 Third St Newport, RI 02840 401-847-4210 (voice) 401-849-1585 (fax) ro...@mt... |