gettext-msvc
gettext-msvc copied to clipboard
mbstate_t in VS2015
Thanks for doing this!
Works in VS2015, but only after:
mbstate_t is undefined (config.h line 383) HAVE_MBSTATE_T is defined (config.h line 177)
Cheers.
I am having trouble building in VS2015. I don't know what previous post means. This is my error: 1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\corecrt.h(475): error C2628: '_Mbstatet' followed by 'int' is illegal (did you forget a ';'?)
@ITISAGLN,
That means in order to build in MSVC 2015, you need to change the file config.h so that the variables mentioned above are defined and undefined appropriately.
Thanks. Helped me get past the same build error in VS 2015.
Just to clarify, you need to comment out
#define mbstate_t int
and remove the comments around
/* #undef HAVE_MBSTATE_T */
So HAVE_MBSTATE_T
should be undefined since that's what #undef
does, not define.
Anybody know why this change isn't merged? It was reported a year ago. Compatibility with older VS?
Thanks for the update as I have not been able to figure this out. ...For the entire project, I did a Ctl-F for "#define mbstate_t int" and "/* #undef HAVE_MBSTATE_T */" and neither was found. Where are these? Not in config.h, right?
It's in https://github.com/kahrl/gettext-msvc/blob/master/libiconv-1.14/config.h
Ah. I was in the gettext project. Thanks alot.
Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped
Thank you
This saved a good amount of my time. Thanks.
Making steps that petermorck
described is still required.
Maybe we should add a note inside README?
when I build finished in vs2015,I using a sample code test it ,but failed ,see follow: //code: #include <locale.h> #include <stdio.h> #include <stdlib.h> #include "libgnuintl.h" //#include "libintl.h" ` int main(void) { setlocale(LC_ALL, "");
bindtextdomain("hello", "locale");
textdomain("hello");
printf(gettext("Hello, world!\n"));
system("pause");
exit(0);
} ` when I compile it,vs2015 ,encounter just an error: Error LNK2001 unresolved external symbol _libintl_setlocale test_gettext_001
//but I using a old head file "#include "libintl.h",(come from:http://gnuwin32.sourceforge.net/packages/gettext.htm),it worked fine.
//I think the new version has better head files,how to solve it?
Thanks. Helped me get past the same build error in VS 2015.
Just to clarify, you need to comment out
#define mbstate_t int
and remove the comments around
/* #undef HAVE_MBSTATE_T */
So
HAVE_MBSTATE_T
should be undefined since that's what#undef
does, not define.Anybody know why this change isn't merged? It was reported a year ago. Compatibility with older VS?
OMG THANK YOU. Still builds in VS 2019