libtool
[Top][All Lists]
Advanced

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

warning about _putenv redeclaration without dllimport in libtool wrapper


From: Vadim Zeitlin
Subject: warning about _putenv redeclaration without dllimport in libtool wrapper script
Date: Tue, 21 Jun 2011 14:36:04 +0200

 Hello,

 I'm using libtool 2.4 under Cygwin 1.7 to build a project using
i686-w64-mingw32-g++ 4.5.3 cross-compiler. This mostly works just fine (in
particular, it's a real relief to not have to worry about the identity
mounts and paths compatibility between MinGW and Cygwin) but I get an error
at the end of the build:

        % make test.exe
          ...
          CXXLD  test.exe
        cc1: warnings being treated as errors
        ./.libs/lt-test.c:39:5: error: '_putenv' redeclared without dllimport 
attribute: previous dllimport ignored

Of course, as the "cc1:" line indicates, usually it's just a warning but
the project I'm working on builds with -Werror so it becomes fatal.

 Of course, the simplest option would be to remove -Werror but I'd prefer
to keep it and correct the warning instead. Unfortunately I don't really
what's the best way to do it. The code of the wrapper script looks like
this:

        /* declarations of non-ANSI functions */
        #if defined(__MINGW32__)
        # ifdef __STRICT_ANSI__
        int _putenv (const char *);
        # endif

And as this project build options also include "-std=c++0x",
__STRICT_ANSI__ is defined. For the compiler I use it would be enough to
add _CRTIMP in front of the declaration as this is how _putenv() is really
declared in /usr/i686-w64-mingw32/sys-root/mingw/include/stdlib.h but I'm
not sure if all MinGW versions define _CRTIMP. I did check that 3.4.5,
4.4.0 and 4.5.0 (native, i.e. not Cygwin) MinGW versions do define it but I
don't have access to earlier versions any more.

 Does anybody know if _CRTIMP is safe to use for all MinGW versions? And,
if so, could someone please add it to the libtool code generating this
wrapper script?

 TIA,
VZ

Attachment: pgp9SjhZoDxxA.pgp
Description: PGP signature


reply via email to

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