Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mbstate_t in VS2015 #1

Open
gnieboer opened this issue Sep 7, 2015 · 9 comments

Comments

Projects
None yet
5 participants
@gnieboer
Copy link

commented Sep 7, 2015

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

This comment has been minimized.

Copy link

commented Jun 5, 2016

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

This comment has been minimized.

Copy link
Author

commented Jun 5, 2016

@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

This comment has been minimized.

Copy link

commented Aug 7, 2016

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

This comment has been minimized.

Copy link

commented Aug 7, 2016

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

This comment has been minimized.

@ITISAGLN

This comment has been minimized.

Copy link

commented Aug 7, 2016

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

@stormsson

This comment has been minimized.

Copy link

commented Nov 6, 2016

Thank you

@quasilyte

This comment has been minimized.

Copy link

commented Feb 1, 2017

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

This comment has been minimized.

Copy link

commented Sep 4, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.