I'm following a tutorial on how the various processes of the compiling work and in order to learn the process I'm producing the executable "by hand" by creating the .i
file first. In order to do so I'm doing the command:
cpp a.cpp > a.i
a.cpp:
#include<iostream>
int main() {
return 0;
}
But an error occurs:
a.cpp:1:9: fatal error: 'iostream' file not found
#include<iostream>
^~~~~~~~~~
1 error generated.
even though the file a.i still gets created with the content:
# 1 "a.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 383 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "a.cpp" 2
int main() {
return 0;
}
Am I supposed to specify the location of iostream
library in order to produce the .i
file? The tutorial doesn't mention it anywhere and I wonder why is it needed at this point.