cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl eas built whitout LIBSSH2

From: Brian Dessent <brian_at_dessent.net>
Date: Wed, 23 Apr 2008 06:40:15 -0700

Stephen Collyer wrote:

> (And while I'm thinking about it, where does that leading
> __imp__ in the symbol name come from ? Is that the prefix
> used by VS when it looks in the list of symbols exported by
> a library ?)

When the compiler emits a call to a function that has been declared with
__declspec(dllimport), the call is an indirect call. The function name
with __imp__ prepended represents the slot in the .idata section (import
table) that contains the address of the function through which the
indirect call occurs.

So the implication if you get a link error about missing symbols
starting with __imp is that your headers declared those functions as
imported from a DLL yet you're trying to link with a static version of
the library. You either need to link with the dynamic version (i.e.
link with the import library) or you need to define the appropriate
symbol (e.g. CURL_STATIC) so that the headers don't declare functions as
being imported.

Brian
Received on 2008-04-23