Switched to ArchLinux, code wont compile

Aug 23, 2015 at 12:36am
I took the huge step from my Win8 OS to ArchLinux. Everything is wonderful except my file (which is in c) wont compile. I get:

a.c:1:21: fatal error: iostream.h: No such file or directory
#include<iostream.h>
^
compilation terminated.

When I look into /usr/include/... I can see the file. What's wrong?
Aug 23, 2015 at 1:37am
If you are compiling in C, that is the problem iostream is a c++ header.
Aug 23, 2015 at 2:26am
I'm including iostream.h, not iostream. I believe iostream.h is the c equivalent.
Aug 23, 2015 at 2:36am
Never mind, I was a bit confused since I'm far more experienced with C++. I was looking for a getch() function for Linux in conio.h but couldn't find one so I checked for an alternative, I didn't realize the alternative was meant for C++. I'm now using a snippet of code which contains that function and all requirements. Thanks!
Aug 23, 2015 at 10:18pm
For clarification, there is no iostream.h in C. The only IO-based header is stdio.h.
getch() can be used from the curses library, although I think there's minor and subtle differences between how it will work from general CONIO implementations.
Aug 24, 2015 at 3:58am
It's all good. The snippet works perfectly. I got a little confused because adding .h at the end of a header usually indicates that it's C.
Topic archived. No new replies allowed.