Compiling with gcc is okay but g++ is not [on hold]
up vote
0
down vote
favorite
Originally gcc -o main main.cpp produce same error like
main.cpp:10:20: fatal error: iostream: No such file or directory
#include <iostream>
But after install gcc with brew (brew install gcc)
and link (brew link gcc), the version of gcc is renew (4.8.1 -> 8.2.0)
So compiling with gcc(gcc -o main main.cpp) is okay but
g++ -o main main.cpp still produce same error message.
What should I do for g++ compile?
macos gcc g++
New contributor
put on hold as too broad by DavidPostill♦ Nov 20 at 20:47
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
0
down vote
favorite
Originally gcc -o main main.cpp produce same error like
main.cpp:10:20: fatal error: iostream: No such file or directory
#include <iostream>
But after install gcc with brew (brew install gcc)
and link (brew link gcc), the version of gcc is renew (4.8.1 -> 8.2.0)
So compiling with gcc(gcc -o main main.cpp) is okay but
g++ -o main main.cpp still produce same error message.
What should I do for g++ compile?
macos gcc g++
New contributor
put on hold as too broad by DavidPostill♦ Nov 20 at 20:47
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
Have you addedusing namespace std;
after the#include
?
– harrymc
Nov 20 at 15:05
Of course.... the code is very very simple and can be compiled with gcc
– cp3
Nov 20 at 15:07
1
Theiostream
file is provided by the corresponding libstdc++ package. Ensure that both g++ and libstdc++ are installed and latest versions. If that doesn't help, show us your code.
– harrymc
Nov 20 at 16:52
I think it's not problem of source code. Actually, I have deleted some files and directories to upgrade gcc and g++ version but I didn't do well.... So , during that course maybe my g++ compiler has gone
– cp3
Nov 21 at 5:20
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Originally gcc -o main main.cpp produce same error like
main.cpp:10:20: fatal error: iostream: No such file or directory
#include <iostream>
But after install gcc with brew (brew install gcc)
and link (brew link gcc), the version of gcc is renew (4.8.1 -> 8.2.0)
So compiling with gcc(gcc -o main main.cpp) is okay but
g++ -o main main.cpp still produce same error message.
What should I do for g++ compile?
macos gcc g++
New contributor
Originally gcc -o main main.cpp produce same error like
main.cpp:10:20: fatal error: iostream: No such file or directory
#include <iostream>
But after install gcc with brew (brew install gcc)
and link (brew link gcc), the version of gcc is renew (4.8.1 -> 8.2.0)
So compiling with gcc(gcc -o main main.cpp) is okay but
g++ -o main main.cpp still produce same error message.
What should I do for g++ compile?
macos gcc g++
macos gcc g++
New contributor
New contributor
edited Nov 20 at 18:53
Viktor Nonov
29815
29815
New contributor
asked Nov 20 at 14:18
cp3
1
1
New contributor
New contributor
put on hold as too broad by DavidPostill♦ Nov 20 at 20:47
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as too broad by DavidPostill♦ Nov 20 at 20:47
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
Have you addedusing namespace std;
after the#include
?
– harrymc
Nov 20 at 15:05
Of course.... the code is very very simple and can be compiled with gcc
– cp3
Nov 20 at 15:07
1
Theiostream
file is provided by the corresponding libstdc++ package. Ensure that both g++ and libstdc++ are installed and latest versions. If that doesn't help, show us your code.
– harrymc
Nov 20 at 16:52
I think it's not problem of source code. Actually, I have deleted some files and directories to upgrade gcc and g++ version but I didn't do well.... So , during that course maybe my g++ compiler has gone
– cp3
Nov 21 at 5:20
add a comment |
1
Have you addedusing namespace std;
after the#include
?
– harrymc
Nov 20 at 15:05
Of course.... the code is very very simple and can be compiled with gcc
– cp3
Nov 20 at 15:07
1
Theiostream
file is provided by the corresponding libstdc++ package. Ensure that both g++ and libstdc++ are installed and latest versions. If that doesn't help, show us your code.
– harrymc
Nov 20 at 16:52
I think it's not problem of source code. Actually, I have deleted some files and directories to upgrade gcc and g++ version but I didn't do well.... So , during that course maybe my g++ compiler has gone
– cp3
Nov 21 at 5:20
1
1
Have you added
using namespace std;
after the #include
?– harrymc
Nov 20 at 15:05
Have you added
using namespace std;
after the #include
?– harrymc
Nov 20 at 15:05
Of course.... the code is very very simple and can be compiled with gcc
– cp3
Nov 20 at 15:07
Of course.... the code is very very simple and can be compiled with gcc
– cp3
Nov 20 at 15:07
1
1
The
iostream
file is provided by the corresponding libstdc++ package. Ensure that both g++ and libstdc++ are installed and latest versions. If that doesn't help, show us your code.– harrymc
Nov 20 at 16:52
The
iostream
file is provided by the corresponding libstdc++ package. Ensure that both g++ and libstdc++ are installed and latest versions. If that doesn't help, show us your code.– harrymc
Nov 20 at 16:52
I think it's not problem of source code. Actually, I have deleted some files and directories to upgrade gcc and g++ version but I didn't do well.... So , during that course maybe my g++ compiler has gone
– cp3
Nov 21 at 5:20
I think it's not problem of source code. Actually, I have deleted some files and directories to upgrade gcc and g++ version but I didn't do well.... So , during that course maybe my g++ compiler has gone
– cp3
Nov 21 at 5:20
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
1
Have you added
using namespace std;
after the#include
?– harrymc
Nov 20 at 15:05
Of course.... the code is very very simple and can be compiled with gcc
– cp3
Nov 20 at 15:07
1
The
iostream
file is provided by the corresponding libstdc++ package. Ensure that both g++ and libstdc++ are installed and latest versions. If that doesn't help, show us your code.– harrymc
Nov 20 at 16:52
I think it's not problem of source code. Actually, I have deleted some files and directories to upgrade gcc and g++ version but I didn't do well.... So , during that course maybe my g++ compiler has gone
– cp3
Nov 21 at 5:20