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.

gcc command not found


Post Reply New Thread Subscribe

 
Thread Tools
frike

 
Member Since: Apr 01, 2008
Posts: 9
frike is on a distinguished road

frike is offline
Hello,

when I try to use the gcc command in terminal I get a message saying "-bash: gcc: command not found"

I have installed Xcode 2.5 and I'm on Leopard.

I've searched the forums for an answer, but I'm really new to this, so I don't know what to do if the PATH is wrong or something like that.

I'd appreciate any help!
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
Log out and back in, and then in terminal type "whereis gcc" minus the quotes.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
frike

 
Member Since: Apr 01, 2008
Posts: 9
frike is on a distinguished road

frike is offline
It couldn't find it before, but now I copied the contents of /Xcode2.5/usr/bin into usr/bin and now it can find it.
It still doesn't work though, when I'm trying to compile something (we have to use Eclipse at Uni) I get an error message saying:

make all
Building file: ../src/TestHelloWorld.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/TestHelloWorld.d" -MT"src/TestHelloWorld.d" -o"src/TestHelloWorld.o" "../src/TestHelloWorld.cpp"
../src/TestHelloWorld.cpp:9:20: error: iostream: No such file or directory
../src/TestHelloWorld.cpp: In function 'int main()':
../src/TestHelloWorld.cpp:13: error: 'cout' was not declared in this scope
../src/TestHelloWorld.cpp:13: error: 'endl' was not declared in this scope
make: *** [src/TestHelloWorld.o] Error 1

which makes me think that just copying the bin contents was not really a solution to my problem.
How can I set it so Eclipse (and the terminal) can find something that lies in /Xcode2.5?
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
Copying the content over isn't the right answer.

It look like the path is not being added in for XCode. Since you didn't report what 'whereis' gave you, we don't know at that level.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
frike

 
Member Since: Apr 01, 2008
Posts: 9
frike is on a distinguished road

frike is offline
well, whereis gcc now gives me /usr/bin/gcc as an answer, since I copied the content.
Before that it was in /Xcode2.5/usr/bin but whereis gcc didn't give me any answer at all.

Anyway, I've included all the includes and libraries paths into Eclipse now, but now there's one error remaining:

/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: /usr/lib/system/libmathCommon.A.dylib load command 6 unknown cmd field

Isn't there some way to get all the directories in /Xcode2.5 included into the proper paths in Eclipse? And into the proper paths for the terminal, since I don't want to always include them manually whenever I'm trying to compile something.

Still, thanks for taking the time to help
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
I don't know Eclipse so can't answer that. In terminal you'll have a login script for the shell you are running. I believe that would be the .profile file. Do a 'man bash' at the terminal prompt.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
in bash .profile would be the one I'd use, well and do use

My path statement in .profile looks like such...

Code:
#paths
export PATH=/Users/mike/scripts:$PATH:/opt/ibm/dscli

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
daqi

 
Member Since: May 13, 2011
Posts: 3
daqi is on a distinguished road

daqi is offline
Hi, guys,

Could you tell me how did you solve the problem below?

/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: /usr/lib/system/libmathCommon.A.dylib load command 6 unknown cmd field

Thanks a lot!

Daqi
QUOTE Thanks

Post Reply New Thread Subscribe


« compiling Freedroid RPG make errors | Editing code for laptop tracpad instead of mouse »
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
'No output devices found' - no sound! doopie Apple Notebooks 36 07-08-2012 11:34 AM
Compile source code GCC ANSI C verbatim210 OS X - Development and Darwin 3 08-27-2007 07:46 AM
iWork 08 image not found??? localfruit OS X - Apps and Games 0 08-09-2007 06:26 PM
Using cc in darwin: command not found. olav OS X - Development and Darwin 2 03-28-2006 03:31 AM
gcc and g++ fedesuarez OS X - Operating System 4 02-01-2006 02:50 PM

All times are GMT -4. The time now is 03:51 AM.

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?