Open BryanWallin opened 5 years ago
I had the same problem. after your commit "handle missing langinfo.h (windows) " i get this messages from mingw32-configure && make on OpenSuse 15.0 :
libtool: compile: i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/i686-w64-mingw32/sys-root/mingw/include/libusb-1.0 -O2 -g -pipe -Wall -fexceptions --param=ssp-buffer-size=4 -mms-bitfields -Wall -Wmissing-prototypes -MT libmtp_la-libmtp.lo -MD -MP -MF .deps/libmtp_la-libmtp.Tpo -c libmtp.c -o libmtp_la-libmtp.o >/dev/null 2>&1
mv -f .deps/libmtp_la-libmtp.Tpo .deps/libmtp_la-libmtp.Plo
/bin/sh ../libtool --tag=CC --mode=compile i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/i686-w64-mingw32/sys-root/mingw/include/libusb-1.0 -O2 -g -pipe -Wall -fexceptions --param=ssp-buffer-size=4 -mms-bitfields -Wall -Wmissing-prototypes -MT libmtp_la-unicode.lo -MD -MP -MF .deps/libmtp_la-unicode.Tpo -c -o libmtp_la-unicode.lo `test -f 'unicode.c' || echo './'`unicode.c
libtool: compile: i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/i686-w64-mingw32/sys-root/mingw/include/libusb-1.0 -O2 -g -pipe -Wall -fexceptions --param=ssp-buffer-size=4 -mms-bitfields -Wall -Wmissing-prototypes -MT libmtp_la-unicode.lo -MD -MP -MF .deps/libmtp_la-unicode.Tpo -c unicode.c -DDLL_EXPORT -DPIC -o .libs/libmtp_la-unicode.o
unicode.c: In function 'utf16_to_utf8':
unicode.c:91:23: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_ucs2_to_locale'
nconv = iconv(params->cd_ucs2_to_locale, &stringp, &convlen, &locp, &convmax);
^~
unicode.c:91:44: warning: passing argument 2 of 'iconv' from incompatible pointer type [-Wincompatible-pointer-types]
nconv = iconv(params->cd_ucs2_to_locale, &stringp, &convlen, &locp, &convmax);
^~~~~~~~
In file included from unicode.c:37:
/usr/i686-w64-mingw32/sys-root/mingw/include/iconv.h:17:48: note: expected 'const char **' but argument is of type 'char **'
size_t iconv(iconv_t cd, WINICONV_CONST char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
unicode.c: In function 'utf8_to_utf16':
unicode.c:126:23: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_locale_to_ucs2'
nconv = iconv(params->cd_locale_to_ucs2, &stringp, &convlen, &unip, &convmax);
^~
unicode.c:126:44: warning: passing argument 2 of 'iconv' from incompatible pointer type [-Wincompatible-pointer-types]
nconv = iconv(params->cd_locale_to_ucs2, &stringp, &convlen, &unip, &convmax);
^~~~~~~~
In file included from unicode.c:37:
/usr/i686-w64-mingw32/sys-root/mingw/include/iconv.h:17:48: note: expected 'const char **' but argument is of type 'char **'
size_t iconv(iconv_t cd, WINICONV_CONST char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
make[2]: *** [Makefile:524: libmtp_la-unicode.lo] Fehler 1
make[2]: Verzeichnis „/home/andreas/SRC/libmtp-master/src“ wird verlassen
make[1]: *** [Makefile:526: all-recursive] Fehler 1
make[1]: Verzeichnis „/home/andreas/SRC/libmtp-master“ wird verlassen
make: *** [Makefile:389: all] Fehler 2
I'm getting the compile error on unicode.c
when using MSYS2/MINGW64:
unicode.c: In function 'utf16_to_utf8':
unicode.c:91:23: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_ucs2_to_locale'
91 | nconv = iconv(params->cd_ucs2_to_locale, &stringp, &convlen, &locp, &convmax);
| ^~
unicode.c: In function 'utf8_to_utf16':
unicode.c:126:23: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_locale_to_ucs2'
126 | nconv = iconv(params->cd_locale_to_ucs2, &stringp, &convlen, &unip, &convmax);
Is there any way to compile libmtp
under Windows, as based on README.windows.txt MSYS/MINGW is the way to go?
@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 asHAVE_LANGINFO_H
is not defined. However, this leads to problems when compiling withmake
, as certain parameters likecd_locale_to_ucs2
andcd_ucs2_to_locale
are defined within an#ifdef
(ptp.h
, line 2810):Then, when I try to use
make
after the./configure
command finishes, I get these errors because there aren't any#ifdef
statements inlibmtp.c
: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?