New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

problem with using gcc


Thread Closed

 
Thread Tools
hchung

 
Member Since: Jun 01, 2009
Posts: 3
hchung is on a distinguished road

hchung is offline
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.
kahlil88

 
kahlil88's Avatar
 
Member Since: Jan 29, 2008
Location: Mendocino, CA
Posts: 678
kahlil88 is a jewel in the roughkahlil88 is a jewel in the rough
Mac Specs: 17" MacBook Pro A1151 2.16 GHz

kahlil88 is offline
I think you need to use gpp (which should be part of gcc) to compile C++ code.

There is no system but GNU and Linux is one of its kernels.
Join the FSF as an Associate Member!

vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,662
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
Do you mean g++? .

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Personal Twitter

Thread Closed


« Determine External Hard Drive Format | Interface Builder Help »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Problem With Keyboard...... mmcltd OS X - Operating System 4 02-02-2010 06:47 PM
Possible faulty CPU thermometer, common problem? dyaballikl Apple Notebooks 6 11-16-2008 12:21 AM
Microsoft Messenger Problem millenium_spike OS X - Apps and Games 4 09-16-2008 01:11 AM
Problem Darwin Server + VLC nanaki Web Design and Hosting 0 03-13-2008 07:27 AM
Problem with ethernet board after installing RAM and upgrading from 10.2.8 to 10.3.5 ydonofrio Apple Desktops 4 02-11-2008 07:16 PM

All times are GMT -4. The time now is 11:20 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?