libtool
[Top][All Lists]
Advanced

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

How to handle warning: `LT_SCOPE' redefined on mingw32?


From: Christian Stimming
Subject: How to handle warning: `LT_SCOPE' redefined on mingw32?
Date: Tue, 29 Aug 2006 12:26:41 +0200
User-agent: Thunderbird 1.5 (Windows/20051201)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm compiling a DLL (say foo.dll) on Windows/mingw32 that links to the
ltdl-DLL as well. To get automake-1.9.6 and libtool-1.5.22 to create my
foo.dll as DLL, I specify the LDFLAGS="-no-undefined". One of the things
that will happen because of this is that libtool adds -DDLL_EXPORT to
the compiler command line. But because I use the libtool dll, I also
need to define LIBLTDL_DLL_IMPORT as otherwise I don't import libtool's
function and variables properly and get a bunch of linker errors.

Here's the deal: If I have both DLL_EXPORT and LIBLTDL_DLL_IMPORT
defined when including <ltdl.h>, I get

  In file included from foo.c:1:
  /usr/local/mingw/include/ltdl.h:134: warning: `LT_SCOPE' redefined
  /usr/local/mingw/include/ltdl.h:131: warning: this is the location of
the previous definition

This will stop every build that wants to compile with -Werror enabled.
And for my DLL, there is absolutely no way around it to avoid this
warning. What is your proposed way to avoid this warning?

The documentation doesn't say anything about DLL_EXPORT or LT_SCOPE or
LTDL_DLL_IMPORT.

Funny enough this has already been discussed in 2001 [1] but the problem
with the created warning still persists in libtool-1.5.22 and obviously
even in the most recent CVS version [2]. As for an actual resolution, I
can imagine several of them and none of them is particularly difficult.
IMHO it's just a matter of properly distinguishing whether the
dllexport/import are used when compiling libtool itself, compared to
compiling some external application/software.

Is everyone simply ignoring the warning and effectively never compiling
with -Werror?

Christian Stimming

(by way of the GnuCash porting to Windows)

[1] http://lists.gnu.org/archive/html/libtool/2001-12/msg00040.html
[2]
http://cvs.savannah.gnu.org/viewcvs/libtool/libltdl/libltdl/lt_system.h?rev=1.2&root=libtool&view=auto
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBRPQWXmXAi+BfhivFAQL9OAQApdM9DeVi9iUz+QKjq0BmTl9mU1vX0rh2
Jp8HN4o15s786kiLHZ4Jd1FgBo8x9Pkrxmm3NHwiih23uEetO1foNP/REW6cZAvo
ylExzrrh3FwwNKNgF3vpix91x0ADza/fqZkYWrWAR4eL5rL0Vfqz7UHtgqG5Lc1L
DQQ8vVGeaaU=
=Ad11
-----END PGP SIGNATURE-----




reply via email to

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