libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: windows static archive, missing symbols


From: Howard Chu
Subject: Re: windows static archive, missing symbols
Date: Fri, 19 Jan 2007 21:52:32 -0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2pre) Gecko/20070113 Netscape/7.2 (ax) Firefox/1.5 SeaMonkey/1.5a

Bob Rossi wrote:
On Fri, Jan 19, 2007 at 06:30:19PM -0800, Howard Chu wrote:
The next question is, why is it looking for an import symbol instead of using the real symbol. The answer to that must lie in your header files; they probably declare the function to be a DLL export, which causes the compiler to generate references to an import symbol. Have a look at your header files. Remove any DLL declspec's on any function declarations you find there; modern linkers don't need them. I.e., the GNU linker is smart enough to use an import symbol in place of a reference to a real symbol. Apparently it won't do the opposite.

Yes, there was this code in the header,
#    ifndef PCRE_STATIC
#      define PCRE_DATA_SCOPE extern __declspec(dllimport)
#    endif

so, I #defined PCRE_STATIC before including pcre.h. This allowed the
link to work.

So, the correct way is to tell the author to remove the declspec's
alltogether from the header file? That will work for both dynamic and
static setup?
Judging from the name of that macro, it may be affecting data declarations. As I said in my previous email, data declarations still need the declspec; you can only omit them for function declarations. If you're sure that the macro is only being used for function declarations then yes, it's safe to remove it.

--
 -- Howard Chu
 Chief Architect, Symas Corp.  http://www.symas.com
 Director, Highland Sun        http://highlandsun.com/hyc
 OpenLDAP Core Team            http://www.openldap.org/project/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]