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/
_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool