views:

47

answers:

2

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/tgmath.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:

  1. http://cygwin.com/ml/libc-alpha/1999-12/msg00021.html
  2. 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?

A: 

This could completely wrong, but make sure you're compiling with -std=c99, complex.h is part of the C99 standard.

Joshua Weinberg
A: 

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

ak2