Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 17, 2007, 03:13 PM   #1
xlopez
macrumors member
 
Join Date: Jul 2006
Taking C beginner course. Newbie building process question

Thanks for entering this thread. I'm having trouble running a .c file I've compiled. In Xcode, when I get Shift + Command + R the simple .c program runs in a log window and an .app file is placed in the build directory of my project. I assume that since I haven't developed an interface for the program, when I click on the .app file, nothing happens. Is that correct? Also, when I try to build the .c file through terminal and I type gcc -o applicationsource.c appname.app, the resultant .app file doesn't run because the classic environment is not supported in leopard. These all lead to the same question, how can I just write a program that can open in any recent mac computer, that just shows an input window followed by an output, as that is all I want for the moment, because of my beginner knowledge. Before you suggest what seems to be the easiest thing to you, remember that I've just started coding in c and I don't understand concepts of program linking, interfaces and the like. So in that case, what I would like is for you to guide me into what I should do, so that I could share a .app program with someone else. Thanks again.
xlopez is offline   0 Reply With Quote
Old Nov 17, 2007, 03:32 PM   #2
Catfish_Man
macrumors 68030
 
Catfish_Man's Avatar
 
Join Date: Sep 2001
Location: Portland, OR
Send a message via AIM to Catfish_Man
You'll want to use Xcode's "commandline tool" template. It sounds like you grabbed the Cocoa App template, which is going to be less useful for a C class.

Personally though, for basic C stuff I just pull out SubEthaEdit or another lightweight editor, and use GCC in terminal.
Catfish_Man is offline   0 Reply With Quote
Old Nov 17, 2007, 03:49 PM   #3
xlopez
Thread Starter
macrumors member
 
Join Date: Jul 2006
Quote:
Originally Posted by Catfish_Man View Post
You'll want to use Xcode's "commandline tool" template. It sounds like you grabbed the Cocoa App template, which is going to be less useful for a C class.

Personally though, for basic C stuff I just pull out SubEthaEdit or another lightweight editor, and use GCC in terminal.
Are you talking about the "Project Type" screen? I always choose "Carbon Application" from the list. Does that have anything to do with it? In any case, can you guide me to "choosing a template", in this case the commandline tool one? Thanks a lot.
xlopez is offline   0 Reply With Quote
Old Nov 17, 2007, 04:43 PM   #4
Catfish_Man
macrumors 68030
 
Catfish_Man's Avatar
 
Join Date: Sep 2001
Location: Portland, OR
Send a message via AIM to Catfish_Man
Quote:
Originally Posted by xlopez View Post
Are you talking about the "Project Type" screen? I always choose "Carbon Application" from the list. Does that have anything to do with it? In any case, can you guide me to "choosing a template", in this case the commandline tool one? Thanks a lot.

Ah ok. I didn't remember the name exactly. Yeah, Carbon is not what you want.
Catfish_Man is offline   0 Reply With Quote
Old Nov 17, 2007, 05:39 PM   #5
xlopez
Thread Starter
macrumors member
 
Join Date: Jul 2006
I succesfully generated a "Unix Executable File" but this file doesn't run on a friend's computer which is running Mac OS X 10.5 on an intel based laptop. She just clicks on it and the TERMINAL application doesn't open. Does this mean that anyone without gcc installed on their system won't be able to open it? Thanks.
xlopez is offline   0 Reply With Quote
Old Nov 17, 2007, 06:59 PM   #6
pilotError
macrumors 68020
 
pilotError's Avatar
 
Join Date: Apr 2006
Location: Long Island
If I click on a console application, it just pops up a window and tells me it can't run because the Classic environment is no longer supported.

If you open terminal then execute it, it should work...

I'm not sure how you would tell OS X to open a terminal and execute the application. Maybe someone here can tell us...
pilotError is offline   0 Reply With Quote
Old Nov 17, 2007, 07:02 PM   #7
kangorillas
macrumors newbie
 
Join Date: Sep 2006
Location: South Florida
Send a message via AIM to kangorillas
Just out of curiosity... Is this an online course?
kangorillas is offline   0 Reply With Quote
Old Nov 17, 2007, 07:06 PM   #8
xlopez
Thread Starter
macrumors member
 
Join Date: Jul 2006
Quote:
Originally Posted by kangorillas View Post
Just out of curiosity... Is this an online course?
No. I'm studying Software Engineering and I'm taking an "Algorithms and Programing" first year class which is about basic computer algorithms and how we can use them. The class is being given in C, so it's not really a C language class. Almost everyone there has windows and they jsut compile and run their .exe files, but with us mac users it's a mess, because there's no real .app file, just an unix executable file that runs if you have gcc installed on your system, at least that's what I understand so far. I just run it on my computer and it's okay, but I want to share it so other people can run it on their computers, and that's what I want to know. Thanks again.
xlopez is offline   0 Reply With Quote
Old Nov 17, 2007, 08:01 PM   #9
Catfish_Man
macrumors 68030
 
Catfish_Man's Avatar
 
Join Date: Sep 2001
Location: Portland, OR
Send a message via AIM to Catfish_Man
You shouldn't need GCC installed; Just Terminal, which is built in.
Catfish_Man is offline   0 Reply With Quote
Old Nov 17, 2007, 08:40 PM   #10
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Just cd to the directory the application is in within Terminal and type ./*APP NAME* obviously changing app name for the relevant name.

That will run your application. Forget about the Finder when you are developing command line tools.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Apple newbie, taking his first, awkward steps into the world MrEnfilade iMac 10 Sep 18, 2013 10:55 AM
Very Beginner Question About iPhoto -iKris- OS X 3 Sep 13, 2013 11:37 AM
Newbie again... aperture taking all space on macbook pro pm79 Mac Basics and Help 8 Sep 28, 2012 03:16 AM
AppleCare+ taking forever to process stevo505 iPhone 5 Sep 24, 2012 07:02 PM
Dock process taking up 100% CPU and event log error every second Warpyb1 Mac Applications and Mac App Store 1 Jun 26, 2012 12:36 AM

Forum Jump

All times are GMT -5. The time now is 02:04 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC