Welcome Guest ( Log In | Register )

Bump Topic Topic Closed RSS Feed

Outline · [ Standard ] · Linear+

 Installing GCC on Macintosh

views
     
TS-Jonathan-
post Sep 16 2007, 02:38 PM, updated 19y ago

Honorary Minister
******
Senior Member
1,430 posts

Joined: Sep 2005
From: Melbourne, Australia


Alrighty, been struggling to install GCC package 4.0 on my macbook.

Wasn't that hard on linux or anything, but i dont know why it ain't working on the mac machine

So i've installed gcc 4.0 and as the matter of fact, even 3.3 on the macbook. I tried saving a .c file in the desktop, running command such as..

gcc <filename.c>, but it says

-bash: gcc: command not found

Im doing computer graphics as well, so the template for compile an openGL is

cc main-good.c -o simple -framework GLUT -framework OpenGL -lobjc
-bash: cc: command not found

Pretty sure that gcc 4.0 is installed because the next time i intended to install, it says upgrade. I've tried linking it using sudo, also to no avail.

Kinda sucky that i can't work this out eventhough its one of my essential unsure.gif

Stupid comp science shakehead.gif
babyk
post Sep 16 2007, 02:42 PM

BANNED 101/100(tm) : Your avatar too sexy
********
All Stars
10,052 posts

Joined: Jan 2003
From: House of Wax
I've been using Intel C compiler and it was ok for me. Never try other company's compiler yet
TS-Jonathan-
post Sep 16 2007, 02:55 PM

Honorary Minister
******
Senior Member
1,430 posts

Joined: Sep 2005
From: Melbourne, Australia


Its not any problem, its just that..haha..i can't compile.i dont know why
Its installed alright...its just myself..
ChopSuey
post Sep 16 2007, 03:58 PM

Getting Started
**
Junior Member
222 posts

Joined: Jan 2005
From: Petaling Jaya


On my Mac, I had to install the Developer Tools from ( I think)
the 3rd installer CD.

Before that, no gcc or xcode was preinstalled. Refer to Apple
Help if necessary.

- yap


Added on September 16, 2007, 3:59 pmDid you install from a tarball off the internet?
Hmmm maybe that's not supported?

This post has been edited by ChopSuey: Sep 16 2007, 03:59 PM
TS-Jonathan-
post Sep 16 2007, 05:07 PM

Honorary Minister
******
Senior Member
1,430 posts

Joined: Sep 2005
From: Melbourne, Australia


I didn't download any installation from the internet

Purely all from the first OS x CD that was given to me in side XTools

And i dont have a 3rd Installer CD, just two CDs, with the second one an expansion installation for the mac osx.


prasys
post Sep 16 2007, 07:48 PM

Heros Never Die
Group Icon
VIP
12,925 posts

Joined: Mar 2005
From: Kuala Lumpur
Get the xcode from Apple. The latest one , that should do it

If it fails then get DarwinPort and then install the gcc package from it.
TS-Jonathan-
post Sep 17 2007, 12:59 AM

Honorary Minister
******
Senior Member
1,430 posts

Joined: Sep 2005
From: Melbourne, Australia


Yea ive downloaded the XTools, latest one from Apple.

900 mb in all.

Just curious, even through the XCode ive downloaded, i assume that it should be the same as the one in the installation CD. I'm just rather stunned that it doesn't work, could it be the directory problem or whatsoever?

A check on darwin port whilst executin sudo

while executing
"macports::selfupdate [array get global_options]"
Error: /opt/local/bin/port: selfupdate failed: Error installing new MacPorts base: shell command "cd /opt/local/var/macports/sources/rsync.macports.org/release/base && ./configure --prefix=/opt/local --with-install-user=root --with-install-group=admin --with-tclpackage=/Library/Tcl && make && make install" returned error 1
Command output: checking build system type... i686-apple-darwin8.10.2
checking host system type... i686-apple-darwin8.10.2
checking target system type... i686-apple-darwin8.10.2
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details


No gcc or cc...this is..making me...bald
tishaban
post Sep 17 2007, 01:55 AM

Look at all my stars!!
*******
Senior Member
3,615 posts

Joined: Feb 2007
Jonathon, open up a terminal window and type which gcc. It should show /usr/bin/gcc

Methinks you're not installing Xtools correctly. Do a custom install and make sure gcc is in that list, and is installed.

TS-Jonathan-
post Sep 17 2007, 02:12 AM

Honorary Minister
******
Senior Member
1,430 posts

Joined: Sep 2005
From: Melbourne, Australia


Last login: Mon Sep 17 14:08:51 on console
Welcome to Darwin!
jonathanong:~ Jonathan$ which gcc
no gcc in /opt/local/bin /opt/local/sbin /bin /sbin /usr/bin /usr/sbin

Your thinking is precise


I just doooble click on the gcc 4.0 and gcc 3.3 to install it. I thought that should be as simple as it could be
TechnoDude94
post Sep 18 2007, 11:56 AM

Happiness Advocate
*******
Senior Member
6,738 posts

Joined: Dec 2006
From: Kuala Lumpur, Malaysia | Eau Claire, Wisconsin


May I know what is GCC? Care to elaborate.
fyire
post Sep 19 2007, 12:18 AM

Look at all my stars!!
Group Icon
VIP
9,270 posts

Joined: Jan 2003
From: Somewhere out there
QUOTE(TechnoDude94 @ Sep 18 2007, 11:56 AM)
May I know what is GCC? Care to elaborate.
*
http://en.wikipedia.org/wiki/GNU_Compiler_Collection
TS-Jonathan-
post Sep 19 2007, 12:19 AM

Honorary Minister
******
Senior Member
1,430 posts

Joined: Sep 2005
From: Melbourne, Australia


http://en.wikipedia.org/wiki/GNU_Compiler_Collection


I'll really appreciate those that can help me with the installation. I desperately need to start compiling my projects
fyire
post Sep 19 2007, 01:04 AM

Look at all my stars!!
Group Icon
VIP
9,270 posts

Joined: Jan 2003
From: Somewhere out there
QUOTE(-Jonathan- @ Sep 19 2007, 12:19 AM)
http://en.wikipedia.org/wiki/GNU_Compiler_Collection
I'll really appreciate those that can help me with the installation. I desperately need to start compiling my projects
*
When u had installed Xcode, does it complain of any errors or anything? Also, in your Finder window, you should see a tab at the side for the Developer tools installed. Under Developer->Applications, you'll find Xcode. Does that work?
TS-Jonathan-
post Sep 19 2007, 05:45 PM

Honorary Minister
******
Senior Member
1,430 posts

Joined: Sep 2005
From: Melbourne, Australia


I manage to tweak and play around, only to find that i wrongly assumed that there was a linkage directly from gcc-4.0 to gcc

so when i type which gcc-4.0, the path was found

The only problem would be now, how do i link my gcc-4.0 to gcc or cc
fyire
post Sep 19 2007, 07:18 PM

Look at all my stars!!
Group Icon
VIP
9,270 posts

Joined: Jan 2003
From: Somewhere out there
sudo gcc_select 4.0
TS-Jonathan-
post Sep 19 2007, 11:20 PM

Honorary Minister
******
Senior Member
1,430 posts

Joined: Sep 2005
From: Melbourne, Australia


jonathanong:~/Desktop Jonathan$ sudo gcc_select 4.0
sudo: gcc_select: command not found

And i found out that i dont have the libraries installed for stdio.h and all those basic libraries. Which XCode file to install ya?

Topic ClosedOptions
 

Change to:
| Lo-Fi Version
0.0165sec    0.91    5 queries    GZIP Disabled
Time is now: 17th December 2025 - 08:29 PM