Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xlopez

macrumors member
Original poster
Jul 13, 2006
30
0
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.
 

Catfish_Man

macrumors 68030
Sep 13, 2001
2,579
2
Portland, OR
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.
 

xlopez

macrumors member
Original poster
Jul 13, 2006
30
0
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.
 

Catfish_Man

macrumors 68030
Sep 13, 2001
2,579
2
Portland, OR
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.
 

xlopez

macrumors member
Original poster
Jul 13, 2006
30
0
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.
 

pilotError

macrumors 68020
Apr 12, 2006
2,237
4
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...
 

xlopez

macrumors member
Original poster
Jul 13, 2006
30
0
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.
 

Cromulent

macrumors 604
Oct 2, 2006
6,802
1,096
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.