views:

797

answers:

4

I know very little about VS, and was surprised when my linux code did not compile on windows. The problem seams from the lack of <complex.h> in VS. My question is this: do people re-implement in their Windows applications, or is there a public domain version.

+2  A: 

<complex.h> is a new feature of ISO/IEC 9899:1999 and Visual Studio (at least up to 2008) only supports ISO/IEC 9899:1990 with some extensions, so complex.h isn't supported.

Charles Bailey
A: 

Ming-CodeBlock support new standard cplusplus.

adatapost
A: 

If you have the option of using C++ instead of C, you can use the complex header. Visual C++ supports C89, but not C99, where complex.h is defined.

If C++ is not an option, you can either use another compiler (there are Windows ports of GCC available, for example), or try to find a third-party implementation.

jalf
c++ is not an option, and neither is compiling via gcc
adk
A: 

since C++ is not an option, and neither is GCC, can't you just... Download the header, and include it into your project yourself: #include"complex.h"? You could download a minimal version of MinGW and just copy the header file over.

Carson Myers
He will also need the libraries.
GMan
can't he just copy those too?
Carson Myers
this answer is wrong: you cannot just use complex.h to get complex support.If you can't use gcc and can't use C++, the only solution is to drop support for C99 complex.
David Cournapeau
Well, I wasn't sure when I posted this answer, it was just a thought that I didn't see elsewhere. Can you be specific as to why it can't be done? Or edit the answer?
Carson Myers