Article View: borland.public.cppbuilder.nativeapi
Article #1232Re: Using __stdcall
From: Sue King
Date: Mon, 15 Oct 2007 04:52
Date: Mon, 15 Oct 2007 04:52
47 lines
2470 bytes
2470 bytes
Bob Gonder wrote:
> Sue King wrote:
>
>> I have some old C code that I wish to compile using the 2007 C/C++ in
>> RAD Studio Professional. This links to a dll that uses __stdcall and
>> gives names such as _Function@4 in the .lib file.
>
> Matching Google links:
> http://groups.google.com/group/borland.public.cppbuilder.winapi/browse_thread/thread/3f81609418611afd
> http://tinyurl.com/37zs7z
>
> http://groups.google.com/group/borland.public.cpp.borlandcpp/browse_thread/thread/87925e78fe34c6c5
> http://tinyurl.com/2n3jbn
>
>> I don't seem to be able to get the compiler to pick up the mangled name.
>> The error is [ILINK32 Error]Error: Unresolved external 'Function'
>> referenced from xx.obj
>
> What does the function delcaration look like?
> It should look something like this
>
> #define MYDLLAPI __declspec(dllimport)
> #ifdef __cplusplus
> extern "C" {
> #endif
> MYDLLAPI BOOL __stdcall Function( /*ParamList*/ );
> #ifdef __cplusplus
> }
> #endif
>
> Another thing, in Borland, __stdcall removes the leading _ that
> C normally places in front of function names. So you might try
> using _Function() in your application.
>
> Or fixup a .DEF file as Ed suggests in the above lnks.
>
>> (Or the correct newsgroup if this is not the right one)
>
> The .IDE group would be ideal for settings.
>
>
I've just found another post relating to linking gcc DLL's with Borland
C and am trying more things from this.
It includes a link showing how to create the .lib from the .def.
Sue
Technical Details
Message-ID:
<4712f1ad$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<47129b93$1@newsgroups.borland.com> <p695h3tbk1cc4q0o89v2nqj1u41e68hlct@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4be438fa70c4738f X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 15 Oct 2007 14:52:12 +1000 From: Sue King <sue@torrensbs.com.au> User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Using __stdcall References: <47129b93$1@newsgroups.borland.com> <p695h3tbk1cc4q0o89v2nqj1u41e68hlct@4ax.com> In-Reply-To: <p695h3tbk1cc4q0o89v2nqj1u41e68hlct@4ax.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 203.34.140.74 Message-ID: <4712f1ad$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1192423853 203.34.140.74 (14 Oct 2007 21:50:53 -0700) Lines: 47 Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail