I have successfully compiled a C-program with GCC
in Mac OS X and Linux, but have got the following error message in Cygwin 1.7.5:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/t开发者_JAVA百科gmath.h:38:21: error: complex.h: No
such file or directory
I have noticed that several guys reported that tgmath.h has problems in Cygwin. However, due to the lack of knowledge I cannot understand if those issues have been already fixed or if they are related to the error I get. See, for example:
- http://cygwin.com/ml/libc-alpha/1999-12/msg00021.html
- http://cygwin.com/ml/libc-hacker/2007-07/msg00012.html
As an experiment, my colleagues have replaced include <tgmath.h>
with include <math.h>
. However, the code threw an exception.
Could you explain me what can be wrong in Cygwin's tgmath.h
or complex.h
, and how I can get through it?
This could completely wrong, but make sure you're compiling with -std=c99
, complex.h is part of the C99 standard.
Unfortunately the complex.h stuff hasn't been implemented for Cygwin (or more precisely, for newlib, which is the C library used by Cygwin).
http://cygwin.com/cygwin-api/std-notimpl.html
精彩评论