|Nov 23, 2005, 12:10 PM||#1|
Question about using C in xcode
Hi, i am not a developer at all, but have been running some numerical models that were written in C by my graduate advisor.
In the past, I have compiled (gcc) on a unix machine with no problems. Using the Xcode interface, I can't get it to read in a ascii file, so the program will not run. Also, i typically run the malloc.h header file, but since it isn't included with mac (i think), it seems that the stlib.h has everyhting that malloc.h has. Basically, my question is how to set up the xcode interace so that I can read in my input files. Like i said, i am not a developer, so i appologize if I sound silly with some of this.
|Nov 23, 2005, 01:25 PM||#2|
You probably are reading in the file with a bad path. We can't do much unless you post code and give a more specific example really...
BTW, if you're not a developer, why use Xcode? For plain ol' C/C++ console apps GCC/Terminal is easier.
|Nov 23, 2005, 05:42 PM||#3|
1. Start up Xcode.
2. From the File menu, select New Project.
A window named Assistant will appear.
3. Under the Command Line Utility section pick select Standard Tool, then press the next button.
4. Name your project and press the Finish button.
5. Find the file main.c and double click on it.
6. Now, paste your code in here. (If you have multiple files, you'll have to do something else, just let me know.)
7. Under the Build menu, select Build. This will compile your code.
If you have any errors, just let me know. I may be able to help out more.
1. Start the Terminal program located on your Mac.
2. Make sure you are in the directory where you c file exists for this explanation.
3. Your file should have a .c extension. I.e., myCodeToBeCompiled.c
4. Type in gcc yourCode.c -o "myExecutable"
5. Let me know if you get any errors.
6. If not, now type ./myExecutable
This will make your program run.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Important Xcode Question||DavidBlack||Mac Programming||5||Feb 25, 2013 12:46 PM|
|question about c++ in xcode||xxcysxx||Mac Programming||5||Dec 30, 2012 01:19 PM|
|Very basic Xcode question||jim51538||Mac Programming||2||Nov 13, 2012 01:00 PM|
|Question for those with ML GM and the new Xcode||Amorino||OS X 10.8 Mountain Lion||1||Jul 10, 2012 06:55 PM|
|xcode interface question||osakamitsu||iPhone/iPad Programming||6||Jun 17, 2012 06:57 PM|
All times are GMT -5. The time now is 08:43 AM.