![]() |
I need to use Xcode for basic C programing. I ve installed Xcode 2.0 but got some problems:
I run xcode, go to file>>>new project>>>command line utility>>>CPP tool. After that i select main.cpp, edit it, build it but then comes this error: Tool:0: Couldn't run '/usr/bin/gcc-3.3' because it does not refer to an accessible executable. what's that error? i m really new to xcode and cant solve this problem... |
That sounds like something is wrong with your Xcode installation. Did you do anything unusual with it?
What version of OS X do you have? What model of Mac do you have? Is it an Intel-based Mac? What do you get from the following commands (in a Terminal window): which gcc ls -l /usr/bin/gcc* |
Quote:
|
i didnt download Xcode, i searched in spotlight and found the setup file for xcode, then installed it.
didnt do anything unsual during installation but maybe i should download it again? i m using a 12' powerbook with 1.5 Ghz G4 processor and 512mb of ddr. OS X version: 10.4.4 what i get is: no gcc in /bin /sbin /usr/bin /usr/sbin maybe the problem is here? i dont understand much at all, new to mac.. : ( |
Quote:
Do you mean that you used Spotlight to search the Tiger DVD? I didn't think Spotlight worked with DVDs. I'm not sure what you did. Xcode is an optional part of the Tiger install. If you look on your Tiger DVD, you should find an optional (or maybe its called "Extras" or something) section. Under that you should find the installer for Xcode Tools. Quote:
Quote:
But you messed up the second command that I asked you to run. Please try again. Copy and paste the 2 lines of commands that I mentioned in my previous post, then press Return, and then copy & paste the results back here. |
Quote:
Quote:
Quote:
it should be: which gcc>>>> no gcc in /bin /sbin /usr/bin /usr/sbin, ls -l /usr/bin/gcc*>>>> lrwxr-xr-x 1 root wheel 7 May 13 17:32 /usr/bin/gcc -> gcc-3.3 EDITED: it's really interesting that i had this xcode setup in my powerbook if it's not a default install. a friend took my pbook when he went to london for 2 weeks... maybe he added xcode setup file, he uses such programs frequently. i dont know where it came from, thought it was default, but you say that it's not.. :confused: |
Quote:
ls -l /usr/bin/gcc* then your Xcode installation is really messed up. You should get something like this: Code:
% ls -l /usr/bin/gcc* |
Quote:
|
reinstalling from the dvd solved the problem!
thanx! : ))) |
Really Simple C/C++ Plea
[QUOTE=orangejuice]I need to use Xcode for basic C programing. I ve installed Xcode 2.0 but got some problems:
:confused: Thus spake OJ, but my needs are really simple, folks. I just want to *start* programming in C (or C++) under 10.3. I've looked at the XCode Tools install package and it looks like a lot more than I need. I'd just like to follow examples in a textbook [such as C++ for Dummies] to write code and compile. And then see if it works -- nothing fancy. The packages shown in Made4Mac at Apple's website seem to be for developers. I'm just not there yet. What can I get and what do I need to load? Sorry if this is posted out of sequence. |
Quote:
Then create a new project in Xcode and choose "Standard Tool" (for C) or "C++ Tool" (for C++) as the project type. Type in your code and press the Build and Run buttons. |
Thanks, hayne
It's worth a try -- thanks for the info re X Code tools.
|
harwell,
Just to add a little to what hayne has said... You don't really have to use Xcode to write C/C++ programs if you are starting out with small examples. You can write your programs in any text editor then compile, link and run them all from the command line in Terminal. But... You'll still need to install Xcode Tools because in addition to installing Xcode, Interface Builder and the other GUI development tools the Xcode Installer also installs all the basic compilers, linkers, libraries, header files, etc. that you need to do your work from the command line. Steve |
Xcode speeds up the development process if you are building a complicated application, but I don't recommend using an IDE for the sole purpose of compiling examples from a book. Just install the Xcode Developer Tools so that you'll have GCC and G++ 4.0, and compile from the command line. To compile a C++ program with just a few source files, type:
Code:
g++ -g -Wall -o [executable name] [source file 1] [source file 2] ... |
Help for Xcode version 2.2.1
Hi All
I am using Xcode version 2.2.1 for C Programming on MAC 10.4.5 intel based processor. I want to get resource fork so I am using API's FSpOpenResFile() , and OSErr FSpOpenRF ( const FSSpec * spec, SInt8 permission, short * refNum ); etc and want to use variable like FSSpec. which library and header file i have to include for using these API's and where is option to include library in Xcode environment. thanx anurags |
Quote:
Quote:
You need to read the Apple developer docs about Carbon and the Help pages for Xcode. The latter covers adding frameworks to your project. |
About Framework Library
Hi All
I am using Xcode 2.3, and project type CoreServices. why there are so many library..it's really very confusing for any user. such as i want to add CorbanLib but i have seen it at so many places such as 1) /System/Library/Frameworks/Carbon.framework/Carbon 2) /System/Library/Frameworks/Carbon.framework/Versions/A/Corban and for CoreServices.h, i have also seen it at so many places. 1) /System/Library/Frameworks/CoreServices.framework/Headers 2) /System/Library/Frameworks/CoreServices.framework/Versions/A/Headers and similary Files.h exists at many places. Act i want to know what it's mean /Vesions/A/Headers why files are here and before it (in hierarchy) anurags |
Quote:
2) You need to read the docs on Xcode & Carbon as I said in my previous post. You aren't going to be successful without doing that. 3) As a beginner, you need to work on lots of small sample programs before you even start working on the program you want to create. Start with one of the examples that Apple has supplied under /Developer/Examples. Modify it slightly, compile & run. Modify again. Then go on to a different example. |
About Xcode 2.3 /Developer/Tools/RezDet
Hi All
Anyone please help me to use Xcode 2.3 use the /Developer/Tools/RezDet utility to examine resource files (whether resource-fork resource files or data-fork resource files) for correctness. Thanks Anurag |
I don't know anything about this, but googling for: RezDet
finds several pages with possibly useful info. Otherwise, you are probably best to ask on the Carbon developers mailing list. |
Xcode for simple C programs
Quote:
That being said, Xcode isn't that bad for writing simple C code, I used it when I was learning to program in C++ and it worked great. In fact, since the Apple programmer tools use gcc to compile, my code files were able to be ported to Linux with no problem. Of course, Visual C++ had some oddities (there's Microsoft for you) and the files needed minor tweaks to compile. Nitewing '98 Nitewing '98's AppleScript Hideout |
| All times are GMT -5. The time now is 06:19 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.