From: Keith Marshall <email@example.com>
Saturday, July 28, 2012 1:57 AM
Re: [Mingw-users] bug unknown type "mbstate_t" in iconv.h
On 28/07/12 01:52, LRN wrote:
>> I did explicitly include /include as a CPPFLAG, but that was to
>> find regex.h (perhaps mistakenly? can I *not* use any headers from
>> msys on my toolchain?)
If you are trying to build a pure (native) windows application, then no,
you MUST NOT do this. (LRN has already pointed you to a source for a
native MinGW regex implementation).
>> a required header for nano.
Then, you MUST use a MinGW compatible version; you CANNOT mix MinGW and
MSYS headers/libs, with any expectation of success.
>> I think I can explicitly cache am_cv_fun_iconv (or can't remember)
>> to bypass the iconv check,
If you've installed a complete and consistent tool chain,then you
shouldn't need to do any such thing; that you're even considering any
such gross hack is a sure clue that you are doing something wrong!
>> assuming that iconv is fine, it's the check that causes the error
>> or use a different iconv. I could use the one from xmlsoft or
packager built an additional mingw-iconv (see below).
> That is exactly the problem. You add /include to include path, and
> when /mingw/include/iconv.h includes wchar.h, it gets the one from
> /include, and guess what? It doesn't have mbstate_t definition in it!
Or, to express it more succinctly, you have a mix of MinGW and MSYS
headers in your build environment; you must NEVER do this. (Your first
mistake was probably to install ANY PART of the MSYS System Builder tool
chain; 99.9% of users don't need it, shouldn't install it, and only
incur a mass of grief when they mistakenly do so).