Reputation: 187
I've got simple program in c++ which include two standard headers
stdio.h and iostream. When I type
gcc main.c
I got error: fatal error: iostream: There is no file or directory even if I rewrite iostream to iostream.h But when I type:
g++ main.c
everything works fine. I have to fix this problem cause my IDE(CodeLite) probably use gcc command
Upvotes: 0
Views: 585
Reputation: 254501
That's how you'd compile a C source file. If you're compiling C++ rather than C, then
.cpp
, .cxx
or .cc
g++
rather than gcc
Upvotes: 2