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.

Simplest Instructions for Compiling


Post Reply New Thread Subscribe

 
Thread Tools
MichiganDavid

 
MichiganDavid's Avatar
 
Member Since: Jan 21, 2009
Location: Midland, Michigan
Posts: 9
MichiganDavid is on a distinguished road
Mac Specs: MB Pro, 17", 2.5 GHz Intel

MichiganDavid is offline
Hi. I am looking for the simplest instructions to compile an executable either using Xcode or from the terminal. I downloaded a sample C program and I want to compile and test it. I don't know where to put the header file that it needs (what directory to put it in) or how to tell gcc where to look (from the Terminal). If I could figure out how to compile in Xcode, that would be cool, because I assume I could get away from typing long path names and stuff.

I imagine this question has been answered in another thread, but I couldn't find it. I will be happy if you can direct me to such a thread, or post the answer here.

Thanks.
QUOTE Thanks
Alexstre

 
Member Since: Jan 06, 2008
Posts: 9
Alexstre is on a distinguished road

Alexstre is offline
Easiest way in XCode would be to create a new C application, then import all your files into your new project. As far as the proper location of the header files and what not, just have a look at includes at the top of the .c files, but usually they'll be in the same directory as your main.c and all your other files (especially for a small/simple application)

If you'd rather use g++ instead and plan to modify that application, you might want to look into makefiles
QUOTE Thanks
MichiganDavid

 
MichiganDavid's Avatar
 
Member Since: Jan 21, 2009
Location: Midland, Michigan
Posts: 9
MichiganDavid is on a distinguished road
Mac Specs: MB Pro, 17", 2.5 GHz Intel

MichiganDavid is offline
Quote:
Originally Posted by Alexstre View Post
Easiest way in XCode would be to create a new C application, then import all your files into your new project. As far as the proper location of the header files and what not, just have a look at includes at the top of the .c files, but usually they'll be in the same directory as your main.c and all your other files (especially for a small/simple application)

If you'd rather use g++ instead and plan to modify that application, you might want to look into makefiles
Thanks for your advice. I have had some success, but I'm having a different problem that I will describe in a new thread.

David
QUOTE Thanks

Post Reply New Thread Subscribe


« C++/ C question | GCC Error..... »
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
Instructions for Removing a RAID card? timetoknow Apple Desktops 16 03-20-2009 04:14 PM
Simplest, safest way to convert files to mac friendly types? bpetruzzo Movies and Video 4 12-09-2008 12:52 AM
Step by step instructions please... mandamommy78 OS X - Operating System 1 10-26-2007 02:02 AM
Re-installed my First Mac OSX ...wow.... read for instructions...VERY HARD! DeathtoToasters OS X - Operating System 12 02-07-2007 07:47 PM
Power Book and Mini repair instructions IChing Apple Notebooks 1 08-03-2005 04:51 PM

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