problem with using gcc

Status
Not open for further replies.
Joined
Jun 1, 2009
Messages
3
Reaction score
0
Points
1
I'm trying to use a c++ program that I made, which is a very simple integrator.
I think I installed everything that I need, such as Dev tools, Xcode, gcc4.0 and other stuff that I might have installed. Anyhow, when I compile my program, it says,
newtonc.cpp:1:19: error: iostream: No such file or directory
newtonc.cpp: In function 'int main()':
newtonc.cpp:31: error: 'cout' was not declared in this scope
newtonc.cpp:31: error: 'endl' was not declared in this scope

I think the problem is that I don't have iostream, which I heard to be installed when I install gcc. I'm pretty sure that I installed gcc, since when I type "which gcc" or "which gcc-4.0", it's saying "/usr/bin/gcc."

It's possible that I installed gcc wrong. I didn't use terminal to install it. instead, i double clicked something called "gcc-intel-bin.tar", and it seemed to install automatically.
I got think link, Installing GCC: Configuration - GNU Project - Free Software Foundation (FSF), and it's extremely difficult to find what I'm doing wrong or to follow what they are saying.

I'm really confused. It would be great if you could help me.
 
Joined
Jan 29, 2008
Messages
703
Reaction score
9
Points
18
Location
Mendocino, CA
I think you need to use gpp (which should be part of gcc) to compile C++ code.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Do you mean g++? ;).
 
Status
Not open for further replies.

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top