Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Newbie: Learning C with X-code

Newbie: Learning C with X-code
Thread Tools
Registered User
Join Date: May 2004
Location: Edmonton, Alberta, Canada
Status: Offline
Reply With Quote
May 24, 2004, 02:52 AM
 
Hi all,
If there are any programmers out there familiar with the x-code interface I would appreciate any assistance.

I am a novice programmer and am going through tutorials of very basic C commands.

I can get a project opened in x-code as well as open and create a c-file. I can also compile and run the commands but the problem is that x-code simply opens an application named after the project and doesn't display the output or offer an input to run the c-files. Is there a way to get around this or should I be using a simpler compiler?? Or am I missing a few steps?? I'd be grateful for any suggestions.
E-mail me!
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
May 24, 2004, 07:21 AM
 
If all you are doing is creating command-line programs, then you can simply run the from the command line. The executable is created inside a folder in your .project folder.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
May 24, 2004, 01:30 PM
 
Did you create a command line tool-style project? It sounds to me like you're creating a GUI app. I've made many command line programs with Xcode.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Mojoma  (op)
Registered User
Join Date: May 2004
Location: Edmonton, Alberta, Canada
Status: Offline
Reply With Quote
May 24, 2004, 04:09 PM
 
Chuck you were right. After some desperate searching I found this great article here:progmacx
Although it is written for Project builder instead of X-code I managed to work it out. There is no need to use the terminal. Here is a step by step for others who are facing the same problem!

1. Open X-code
2. Under File select new project
3. In next window scroll all the way down to standard tool
4. Name your project and enter the filepath to where you want to store it.
5. Double-click the file main.c in your project window. (an editor will open up containing sample code)
6. Clear editor space and enter your C code.
7. Click Build and debug under the build and go icon.
8. If your code is good, a small "Succeeded" and Hammer Icon shows up on the right side of the debug window.
9. Click the hammer Icon
10. In the newly opened Build window Hit run.
Ta-Daaa!!!!
(Last edited by Mojoma; May 24, 2004 at 04:15 PM. )
     
Mojoma  (op)
Registered User
Join Date: May 2004
Location: Edmonton, Alberta, Canada
Status: Offline
Reply With Quote
May 24, 2004, 04:33 PM
 
If you do want your executable to open in the terminal you can do this by double clicking the executable file that shows up in your project window after your have built your commands.

The file shows up as a little paper and pencil icon similar to the script editor icon except more square(sic.)
     
Mojoma  (op)
Registered User
Join Date: May 2004
Location: Edmonton, Alberta, Canada
Status: Offline
Reply With Quote
May 24, 2004, 04:55 PM
 
If you are working with de-bugging exercices you need to select "save-all" in the prompt window each time you are re-building your code in order for your changes in the code to be recognized.
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 06:32 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2