[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gettext] Problems compiling gettext with mingw
From: |
Jan Ingwer Baer |
Subject: |
[bug-gettext] Problems compiling gettext with mingw |
Date: |
Sun, 18 Sep 2016 16:39:28 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
I've got some problems while compiling gettext (version 0.19.8.1) with
mingw. GCC-Version is : 5.3.0 x86_64-posix-seh-rev0, MinGW-W64
First there are some warnings about ignored dllimport attribute:
format-php.c:399:28: warning: 'formatstring_php' redeclared without
dllimport attribute: previous dllimport ignored [-Wattributes]
struct formatstring_parser formatstring_php =
I've found a mistake in the define for the DLL_VARIABLE-macro:
/* On Windows, variables that may be in a DLL must be marked specially. */
#if ((defined _MSC_VER && defined _DLL) || defined WOE32DLL) && !defined
IN_RELOCWRAPPER
# define DLL_VARIABLE __declspec (dllimport)
#else
# define DLL_VARIABLE
#endif
This defines DLL_VARIABLE always as __declspec(dllimport).
I changed it to:
/* On Windows, variables that may be in a DLL must be marked specially. */
#if ((defined _MSC_VER && defined _DLL) || defined WOE32DLL) && !defined
IN_RELOCWRAPPER
# if ((defined DLL_EXPORT) || (defined BUILDING_DLL))
# define DLL_VARIABLE __declspec (dllexport)
# else
# define DLL_VARIABLE __declspec (dllimport)
# endif
#else
# define DLL_VARIABLE
#endif
Now the define of DLL_VARIABLE is right for building a DLL, and the
warning about ignored dllimport-attribute is gone. I think the change
must go to configure.ac which generates config.h.in.
---
Second i've got some errors about undefined references while linking the
commandline-tools:
../woe32dll/msgmerge-c++msgmerge.o:c++msgmerge.cc:(.rdata$.refptr.simple_backup_suffix[.refptr.simple_backup_suffix]+0x0):
undefined reference to `simple_backup_suffix'
My solution to this is to delete the linker-flag --disable-auto-import
from gettext-tools/src/Makefile:
change
LDFLAGS = -Wl,--disable-auto-import
to
LDFLAGS =
Because the makefile is generated by configure this change will be
reverted by every run of configure. But i have not enough knowledge to
autotools to decide which change to configure.ac is needed to make the
change permanent.
After this two fixes i can build gettext without errors and everything
works fine.
I hope this was helpfull.
Greetings from Berlin, Germany
Jan Ingwer Baer
- [bug-gettext] Problems compiling gettext with mingw,
Jan Ingwer Baer <=