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?










share|improve this question









New contributor




cp3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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 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















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?










share|improve this question









New contributor




cp3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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 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













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?










share|improve this question









New contributor




cp3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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++






share|improve this question









New contributor




cp3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




cp3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 20 at 18:53









Viktor Nonov

29815




29815






New contributor




cp3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 20 at 14:18









cp3

1




1




New contributor




cp3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





cp3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






cp3 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




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 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














  • 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








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















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]