CPB Mailing List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Linking a DLL
Did you compile your .DLL with _stdcall or _cdecl declaration?
The @ seems kind of strange.
Jack Romanowicz wrote:
> This will be a bit of a long tale. I'm telling the whole thing
> because
> maybe my current problem can be avoided by using another path to my
> goal.
>
> I need to call C code from a Delphi unit that I'm using in my BCB
> project. Rewriting the unit's not an option, because I have a large
> number of them. I have created the external function and local
> structure declarations in the unit and added a call to a C function.
> I
> added a directive to include the C function's .obj file in the unit.
> But the compile failed, because the compiler found unresolved
> references
> to functions called by the called function. So apparently the
> compiler
> wants to resolve ALL function references.
>
> All right, I decided to make my C module into a DLL. I created a new
> project and compiled it to a DLL with no problems. My single function
>
> is declared thusly:
>
> extern "C" __declspec(dllexport)
> PasswordFormat * _fastcall PasswordIO( char * UserID ) ;
>
> The unit now compiles in Delphi. Hooray! But, when I attempt to
> compile
> it in BCB, I get the message " Undefined symbol in
> K:\CBUILDER|QQ|PASSWORD.OBJ". No symbol name is given.
>
> BTW, the Exports listed in my DLL by TDUMP show the funciton name as
> "@PasswordIO". I thought the @ indicated a mangled name, which the
> "C"
> in the function declaration should have circumvented. But if it's
> mangled, where's the parameter information?
>
> Anyone have thoughts on how I can get out of this mess? I need to
> solve
> this in a hurry.
>
> As an aside, what is a "type object file", as in the compiler warning
> "No thpe object file present. Disabling external types option"?
>
> Thanks in advance for any help, guesses, or observations.
>
> Jack Romanowicx
W Komornicki's Home Page |
Main Index |
Thread Index