kahrl / gettext-msvc

Visual Studio 2013 solution for gettext-0.19.4 and libiconv-1.14
27 stars 19 forks source link

mbstate_t in VS2015 #1

Open gnieboer opened 8 years ago

gnieboer commented 8 years ago

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.

ITISAGLN commented 8 years ago

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 ';'?)

gnieboer commented 8 years ago

@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.

petermorck commented 8 years ago

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?

ITISAGLN commented 8 years ago

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?

petermorck commented 8 years ago

It's in https://github.com/kahrl/gettext-msvc/blob/master/libiconv-1.14/config.h

ITISAGLN commented 8 years ago

Ah. I was in the gettext project. Thanks alot.
Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped

stormsson commented 7 years ago

Thank you

quasilyte commented 7 years ago

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?

ghost commented 6 years ago

when I build finished in vs2015,I using a sample code test it ,but failed ,see follow: //code:

include

include

include

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?

grannypron commented 3 years ago

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