|
|
Compiling program in C to run in Terminal
|
|
|
|
Dedicated MacNNer
Join Date: Oct 2001
Location: California
Status:
Offline
|
|
Disclaimer: I am not a programmer. I am a Mac user.
I am running LabVIEW for Mac and Windows and in Windows it calls the Dos prompt and runs a program written in C. I'm thinking I could do this on the Mac in Terminal, but I would need to compile the program in the right language and get it to run. Any ideas how to get started on this? What language to compile? Software that may help me compile it? Thanks.
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jan 2002
Location: Trondhjem, Norway
Status:
Offline
|
|
This is really a question for the developer forum, but a short answer would be to install the Developer Tools package that comes with OS X. (Or register as an ADC member at apple and download it from there. It's free.)
Then you'll have gcc, the standard compiler, which can compile C programs (and other languages too).
From the command line it would look something like:
% cc -o myprogram myprogram.c
Then you'll have an executable called myprogram that can run in Terminal.
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Feb 2003
Location: Portland, Oregon
Status:
Offline
|
|
gcc file.c
mv a.out myapp.command
When a .command file is double clicked, it opens a new terminal window and executes the files.
jesse ;-)
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Nov 2002
Location: Rockville, MD
Status:
Offline
|
|
do you have the source code (a .c file) for this program? it won't work if you just have the excutable program
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Oct 2001
Location: California
Status:
Offline
|
|
Thanks for your help!
I do have the source code, or actually the guy who wrote it is sending it to me from Germany. Hope it works, this would make my life much easier!
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status:
Offline
|
|
Originally posted by surfacto:
Thanks for your help!
I do have the source code, or actually the guy who wrote it is sending it to me from Germany. Hope it works, this would make my life much easier!
Unless this app is trivial, or just uses plain vanilla std library stuff, I wouldn't expect this to be too easy for someone who doesn't write software at all.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|