Description
@msmeissn (correct me if you're not the right contact),
I'm attemtping to create a .dll using MSYS2 and MINGW64, and I'm running into an issue revolving around the missing langinfo.h
header. It looks like the config.h file is generated properly as HAVE_LANGINFO_H
is not defined. However, this leads to problems when compiling with make
, as certain parameters like cd_locale_to_ucs2
and cd_ucs2_to_locale
are defined within an #ifdef
(ptp.h
, line 2810):
#if defined(HAVE_ICONV) && defined(HAVE_LANGINFO_H)
/* PTP: iconv converters */
iconv_t cd_locale_to_ucs2;
iconv_t cd_ucs2_to_locale;
#endif
Then, when I try to use make
after the ./configure
command finishes, I get these errors because there aren't any #ifdef
statements in libmtp.c
:
libmtp.c: In function 'LIBMTP_Open_Raw_Device_Uncached':
libmtp.c:1879:17: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_locale_to_ucs2'
current_params->cd_locale_to_ucs2 = iconv_open("UTF-16LE", "UTF-8");
^~
libmtp.c:1879:39: warning: implicit declaration of function 'iconv_open'; did you mean '_open'? [-Wimplicit-function-declaration]
current_params->cd_locale_to_ucs2 = iconv_open("UTF-16LE", "UTF-8");
^~~~~~~~~~
_open
libmtp.c:1880:17: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_ucs2_to_locale'
current_params->cd_ucs2_to_locale = iconv_open("UTF-8", "UTF-16LE");
^~
libmtp.c:1882:20: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_locale_to_ucs2'
if(current_params->cd_locale_to_ucs2 == (iconv_t) -1 ||
^~
libmtp.c:1882:44: error: 'iconv_t' undeclared (first use in this function); did you mean 'ino_t'?
if(current_params->cd_locale_to_ucs2 == (iconv_t) -1 ||
^~~~~~~
ino_t
libmtp.c:1882:44: note: each undeclared identifier is reported only once for each function it appears in
libmtp.c:1883:20: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_ucs2_to_locale'
current_params->cd_ucs2_to_locale == (iconv_t) -1) {
^~
libmtp.c: In function 'LIBMTP_Release_Device':
libmtp.c:2431:3: warning: implicit declaration of function 'iconv_close'; did you mean '_findclose'? [-Wimplicit-function-declaration]
iconv_close(params->cd_locale_to_ucs2);
^~~~~~~~~~~
_findclose
libmtp.c:2431:21: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_locale_to_ucs2'
iconv_close(params->cd_locale_to_ucs2);
^~
libmtp.c:2432:21: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_ucs2_to_locale'
iconv_close(params->cd_ucs2_to_locale);
I think this is an issue that needs to be solved in the libmtp library, or if it cannot be, it needs to be made clear that this cannot compile on MINGW/MSYS2. Is there a suggestion of something I could do to fix the issue in the meantime?