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.

Developing on a macbook


Post Reply New Thread Subscribe

 
Thread Tools
boletje

 
Member Since: Jul 14, 2006
Posts: 29
boletje is on a distinguished road

boletje is offline
Decided to continue what i began learning about 2 months ago, and that is the C language. So i hear that i need something called Apple Developer Tools.

After searching their site on the developer tools, i came across something called xcode 2.0 (approx. 960Mb). Is this what i need so that i can begin develpment programs on my macbook?
QUOTE Thanks
karudzo

 
Member Since: May 27, 2006
Location: Concord, NC
Posts: 445
karudzo has a spectacular aura about
Mac Specs: Macbook Pro 17" 2.6GHz 4GB RAM

karudzo is offline
Yes- it works great.
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
Xcode comes on your install disks, so you don't have to download the very latest from Apple. The downlaod requires an ADC membership of which they have a free version.
QUOTE Thanks
boletje

 
Member Since: Jul 14, 2006
Posts: 29
boletje is on a distinguished road

boletje is offline
so i downloaded apple developer tools (Xcode 2) and installed it. I made doubly sure i had GCC 3.3 and 4.0 installed aswell as X11 but, i assume the main installer installs these rather then me having to go through every package manually.

I wrote a simple "Hello" program using the text editor "VI" in terminal. But..im a little unsure how to execute. normlly i did "a.out test" and it would compile and run..but it appears differently in OS X.

Anything im doing wrong? my code is below..but i know its rght lol..

#include stdio.h

main()
{
printf("Hello worl/n");
}
QUOTE Thanks
D3v1L80Y

 
D3v1L80Y's Avatar
 
Member Since: Feb 02, 2004
Location: PA
Posts: 12,459
D3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond reputeD3v1L80Y has a reputation beyond repute
Mac Specs: MacBook

D3v1L80Y is offline
NOTE: Continuation of previous post. Merged threads

__________________________________________________
Posting and YOU|Forum Community Guidelines|The Apple Product Cycle|Forum Courtesy

mac: a waterproof raincoat made of rubberized fabric
MAC: a data communication protocol sub-layer, also known as the Media Access Control
Mac: a brand name which covers several lines of personal computers designed, developed, and marketed by Apple Inc.

QUOTE Thanks
Amen-Moses

 
Member Since: Apr 25, 2003
Location: The home of the free and the land that did for Braveheart.
Posts: 1,301
Amen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really nice
Mac Specs: 24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs

Amen-Moses is offline
Quote:
Originally Posted by boletje View Post
so i downloaded apple developer tools (Xcode 2) and installed it. I made doubly sure i had GCC 3.3 and 4.0 installed aswell as X11 but, i assume the main installer installs these rather then me having to go through every package manually.

I wrote a simple "Hello" program using the text editor "VI" in terminal. But..im a little unsure how to execute. normlly i did "a.out test" and it would compile and run..but it appears differently in OS X.

Anything im doing wrong? my code is below..but i know its rght lol..

#include stdio.h

main()
{
printf("Hello worl/n");
}

a.out is the default name for the executable created by cc after it is compiled and linked.

If your source file is called test.c then try cc test.c

And it probably should be #include "stdio.h"

Oh and you left the d off of "world".

Amen-Moses

(edited to add: Mind you, you really want to use XCode, if you have fully installed it the main XCode executable is in /Developer/Applications.

Google for XCode tutorials as well.)
QUOTE Thanks
boletje

 
Member Since: Jul 14, 2006
Posts: 29
boletje is on a distinguished road

boletje is offline
ok thanks for the quick reply! I just tried what you suggested and its given me two error msgs...

i686-apple-darwin8-gcc-4.0.1: test: no such file or directory
i686-apple-darwin8-gcc-4.0.1: no input files

Opened the file using Xcode...cant build or do anything else other then edit with it. The file is saved in the same location as where ive pointed all the project files to go ... simon/Documents/C_Proj_Files
QUOTE Thanks
Amen-Moses

 
Member Since: Apr 25, 2003
Location: The home of the free and the land that did for Braveheart.
Posts: 1,301
Amen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really nice
Mac Specs: 24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs

Amen-Moses is offline
Quote:
Originally Posted by boletje View Post
ok thanks for the quick reply! I just tried what you suggested and its given me two error msgs...

i686-apple-darwin8-gcc-4.0.1: test: no such file or directory
i686-apple-darwin8-gcc-4.0.1: no input files

Opened the file using Xcode...cant build or do anything else other then edit with it. The file is saved in the same location as where ive pointed all the project files to go ... simon/Documents/C_Proj_Files

Have you got the .c on the end?

btw XCode is a full GUI development tool, you really need to read a tutorial on it.

Amen-Moses
QUOTE Thanks
boletje

 
Member Since: Jul 14, 2006
Posts: 29
boletje is on a distinguished road

boletje is offline
yes, the file is called.. "test.c"
QUOTE Thanks
Amen-Moses

 
Member Since: Apr 25, 2003
Location: The home of the free and the land that did for Braveheart.
Posts: 1,301
Amen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really nice
Mac Specs: 24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs

Amen-Moses is offline
Quote:
Originally Posted by boletje View Post
yes, the file is called.. "test.c"
Well in that case ...

cc test.c

followed by (assuming no errors) ...

./a.out

Should do the trick if everything is installed correctly.

(Oh and you have to be in the same directory as the test.c file but I assumed that was obvious.)

Amen-Moses
QUOTE Thanks
novicew

 
novicew's Avatar
 
Member Since: Jan 04, 2006
Location: Hamburg, Germany
Posts: 1,385
novicew is a name known to allnovicew is a name known to allnovicew is a name known to allnovicew is a name known to allnovicew is a name known to allnovicew is a name known to allnovicew is a name known to all
Mac Specs: MacBook Pro | iMac(2.1 G5) | MacBook(2.16 C2D) | MacMini (1.67 CD) | iPhone 4 | iPad (3rd Gen)

novicew is offline
In Terminal
test.c
Quote:
#include <stdio.h>

int main()
{
printf ("Hello World\n");

}
$gcc -o test test.c ---> to create an execution file.

$./test --->to execute
QUOTE Thanks
boletje

 
Member Since: Jul 14, 2006
Posts: 29
boletje is on a distinguished road

boletje is offline
i just get the message from bash that "-o command not found"

UPDATE: seemed to work eventually. i just moved the file from location..replaced it and it seemed to work. TY for help
QUOTE Thanks

Post Reply New Thread Subscribe


« Mac Terminal | Color your Mac Terminal? »
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
19 Days with a Macbook Pro b.hicks Switcher Hangout 23 03-01-2010 12:49 AM
MacBook impressions - trip to store kaidomac Schweb's Lounge 24 10-14-2007 01:45 PM
Question about Memory Card Reader on Macbook markw10 Apple Notebooks 3 05-03-2007 04:40 PM
MacBook Review from a New Owner. My 2 Cents. itsdaydrmer Schweb's Lounge 5 12-08-2006 04:54 AM
The "Mod your MacBook" thread kaidomac Apple Notebooks 50 07-11-2006 08:49 PM

All times are GMT -4. The time now is 04:44 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?