Compiler error - missing iconv.h with -mno-cygwin

2009-01-26 Thread Ian Puleston
Hi,

I have a program that uses libxml2 and compiles fine under Cygwin when I
compile it as a Cygwin app. However, I want to compile a stand-alone version
so I updated the Makefile to add CFLAGS += -mno-cygwin and LDFLAGS +=
-mno-cygwin (I'm using gcc 3.4.4), and with these it fails to compile
because it cannot find iconv.h:

gcc -I/usr/include/libxml2 -mno-cygwin   -c -o xmlParse.o xmlParse.c
In file included from /usr/include/libxml2/libxml/parser.h:797,
 from xmlParse.c:36:
/usr/include/libxml2/libxml/encoding.h:28:19: iconv.h: No such file or
directory
In file included from /usr/include/libxml2/libxml/parser.h:797,
 from xmlParse.c:36:
/usr/include/libxml2/libxml/encoding.h:136: error: parse error before
iconv_t
/usr/include/libxml2/libxml/encoding.h:136: warning: no semicolon at end of
struct or union
/usr/include/libxml2/libxml/encoding.h:137: warning: data definition has no
type or storage class
make: *** [xmlParse.o] Error 1

But iconv.h does exist in /usr/include, so why can the compiler not find it?
Is it looking somewhere different for include files when compiling with
-mno-cygwin?

Ian



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Compiler error - missing iconv.h with -mno-cygwin

2009-01-26 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ian Puleston on 1/26/2009 3:51 AM:
 But iconv.h does exist in /usr/include, so why can the compiler not find it?
 Is it looking somewhere different for include files when compiling with
 -mno-cygwin?

Yes, the compiler is looking somewhere else when you use -mno-cygwin;
after all, that option means that you are not compiling for cygwin
(implicitly, it means you are cross-compiling for mingw).  The confusion
caused by this option that turns on cross-compilation is also the reason
that the gcc-4 release will not support -mno-cygwin.  Search the list
archives for more details.  Ask the mingw list if you need more details of
why mingw does not provide iconv.h.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl9scwACgkQ84KuGfSFAYAajACcCQbBJJ440PrUjZZGrxbi8CVE
Bt0An1NXNS5HKnmY3/ebm7bDyKj+glWo
=FTn8
-END PGP SIGNATURE-

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/