Programming in C/C++ using Xcode

I know that Mac OS is based on Unix, NetBSD, and etc. I know that Xcode is a really good compiler that works well, but I have no idea what is what. I do not know if anyone can give some hints or books I can read to learn.
I used C/C++ compilers under windows most of the time, so I have no Xcode experience at all.

Xcc19891 wrote:
I know that Mac OS is based on Unix, NetBSD, and etc. I know that Xcode is a really good compiler that works well, but I have no idea what is what.
Xcode is not a compiler but an IDE.
gcc and g++ are the (command line) compilers for C and C++, respectively.
Please check http://www.gnu.org for more information.
Mihalis.

Similar Messages

  • Unable to Run C Program using Xcode "Stop Executable"

    Hi All
    Have been using the Terminal to compile programs built through Xcode but now want to use Xcode itself. Everytime I press build and go it builds successfully but won't run. I found a tutorial that mentioned if you are using Xcode 3.0 (I am) you can't use build and run, for output, you have to go to run and then push console.Ok that works. I then found someone with the same issue as mine everytime you want to build and run it appears with another window saying "Stop Executable"They were told to make sure they were building the .c file in a project and not building it from a text editor and then importing. I always build new projects.
    I want to interact with the program not just see its output? so my question is can I interact with programs i.e. User can enter data or strings or, do I have to build an interface to do this through Xcode. I Also forgotten to mention I found information through the forum that said to go to First Aid through utilities and repair file permissions, this has been done but still does not work. Many thanks for your time and as you can probably tell I am new to Xcode.

    To run your command-line program in Xcode, open the debugger console by choosing Run > Console. Run your program by choosing Run > Run or Build > Build and Run. You'll have to build and run if you haven't compiled the program before. Your program will run, and you will see output in the console. You interact with the program from the console.
    If you're not able to enter input in the console, choose Run > Sync with Debugger. If doing that doesn't work, you can run your program in the Terminal application by double-clicking the program from the Finder. It's less convenient than running it in Xcode, but you'll at least be able to run the program and interact with it.

  • Programming for the mac without using xcode

    Hi
    I'm very new to programming for Apple platform. I wanted to clear some doubts which is currently standing as a barrier in getting started.
    Can I use a text editor (preferably TextMate), Interface Builder, and the Terminal (without using xcode to write & compile) to develop software for the Mac. I have installed the xcode package (~900 mb image).
    Can you point me to some resources on terminal commands for compile, debug codes for the mac. (Obj-C, Cocoa api)
    Thank You.
    Message was edited by: jase21

    You can use anything you want to develop software for the Mac. In fact, I always encourage people to start out with tutorials and examples using standard UNIX command line tools like vi and gcc. There are plenty of such getting started tutorials for UNIX and Linux.
    At some point, however, the command line is going to get cumbersome. You may want go start writing true Mac applications instead if command line tools. Then it will be time to start with Xcode.

  • I want to use Xcode to create an app and i need developer tools. so i need to join the devoper program only problem is I'm not 18

    i want to use Xcode to create an app and i need developer tools. so i need to join the devoper program only problem is I'm not 18

    You can get Xcode without joining the developer program. Just go to the App Store and download it (it's free).
    You'd only need to join the Developer program if you want to put your app into the App Store, this is for OS X.
    You will need to join the Developer program if you want to develop for IOS. In that case you will need a parent or guardian.

  • Hello friends , I have started with writing  c code on mac using xcode .....but one of my friend told me to use gcc for coding. He started with terminal And used a text editor to compil the c program on his mac.. So please tell me how to do the same

    Hello friends , I have started with writing  c code on mac using xcode .....but one of my friend told me to use gcc for coding. He started with terminal And used a text editor to compil the c program on his mac.. So please tell me how to do the same and is there any pre stalled text editor on mac if yes then where and if no then which text editor to install and how to install gcc...please help me out thanks in advance !!!

    I have started with writing  c code on mac using xcode .....but one of my friend told me to use gcc for coding.
    Why? If you are developing and writing code on a Mac why would you not use the tools Apple has given you? And Xcode, once you get use to it, is a very nice development environment that will make you life a whole lot easier.
    If you insist on using an editor and the terminal I would recommend  Emacs   but it has a long learning curve so  something like TextWrangler  will work too.
    As for the compiler if you have Xcode installed install the command line tools and you will be able to compile from the terminal.
    good luck

  • I have created an iPhone app using xCode and am now ready to publish it. Do I have to sign up to the $99/yr program in order to get a certificate?

    I have created an iPhone app using xCode and am now ready to publish it. Do I have to sign up to the $99/yr program in order to get a certificate? I keep getting the error message: CodeSign Error: code signing is required...although the app tests fine on the simulator. Does this mean that I need to pay the $99 to create the app or do you only need to pay if you want it published on iTunes?
    Any advice will be gratefully received.

    App Store Resource Center - Apple Developer

  • Hello , how r u,  can i ask 1 question about xcode, i have mac os x 10.7.5 , n xcode version 4.6.3 i want build apps for ios 7.1 n mac os 1.9 ,, , but my macbook is old late 2008 macbook 4,1,  so can i develop apps for ios7 n 1.9 using xcode 4.6.3, bcz my

    hello , how r u,
    can i ask 1 question about xcode, i have mac os x 10.7.5 , n xcode version 4.6.3 i want build apps for ios 7.1 n mac os 1.9 ,, , but my macbook is old late 2008 macbook 4,1,  so can i develop apps for ios7 n 1.9 using xcode 4.6.3, bcz my machine cant upadte on 1.8 n 10.9,, ihave 2gb ram . core 2 duo pr, plz rely asap,
    thnxs

    Please type complete sentences and words.  This isn't an instant message program.
    https://developer.apple.com/support/ios/ios-dev-center.html

  • How to create a static library using xcode ?

    Hi,
    I need to create a C static library using xcode in order to use it in another developement environment which is Free Pascal Compiler/Lazarus.
    I have very few knowledge about C. I just know how to program the function I need and I've already written my C function using xcode.
    Using Lazarus (Pascal IDE), for example, as I use IOKit, I have declared the path of IOKit in the linking section (that is /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/IOKit.framework/IOkit) . IOKit is a unix executable, and I can use the exported functions it contains in my Pascal code.
    So, I would build such kind of unix executable where I can put my own functions written in C. But I can't figure out how to do it.
    How to export my functions ? Must I use some specific C keywords to "publish" them (export, __export,...) ? How to create an executable file like IOKit ? Which kind of project must I choose in XCode ?...
    André.
    Message was edited by: sinfoni12345
    Message was edited by: sinfoni12345

    Thanks for the response.  Yes, that's how I started.  I have now managed to get it to build static libraries; the piece I was missing was the scheme stuff.  I also tried to build dynamic libraries, but still no luck with those.  It was a little confusing because sometimes if I started a new project the scheme would allow me to create output as is; other times I had to edit the scheme first.  So reading the documentation appears to have paid off after all.
    FWIW, what I was trying to build was a missing library needed for a project in Python.  The entire project has two C libraries, which I've managed to build now, altough I don't know if there are some specific options that I need to set for them to work with the C wrapper.  The C wrapper is written in Cython, which creates a C file from Python-like statements.  The end result of linking the two libraries and the compiled C wrapper should be a file that can be imported into Python, which should have an extension of ".so".
    So far the last part is not working, so I don't know if the problem is with the build settings for the libraries, or something else.

  • How to use Xcode Tools with a Command Line Project

    I'm using Xcode 3.2.6, C compiler.  I've had an application for years that is command-line on the terminal, compiling with a makefile.  Now I want to actually use the performance tools included with Xcode, such as threads, time profiler, etc.  How do I do this?
    I created a project for it (never did that before), added source files, etc -- it seems to work.  It created the application, which will run via the terminal like always.  But whenver I try to use Run (inside Xcode), a window opens up saying "Stop Executable".  I have to click OK and that's the end of it.  Nothing has happened.
    I found an old query on the web similar to this from 2008.  The suggestion was to open the console.  Still nothing.  "Sync with Debugger" does no good.  Please help!

    That I understood.  I did try Run > Console.  Nothing intelligible happened.  Then I synced with the debugger.  he program is called fer64.  I get this:
    No executable file specified.
    Use the "file" or "exec-file" command.
    No executable file specified.
    Use the "file" or "exec-file" command.
    The program being debugged is not being run.
    The program being debugged is not being run.
    Not executing.
    (gdb) r fer64
    Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Con tents/Resources/PBGDBIntrospectionSupport.A.dylib")
    Starting program:  fer64
    Not executing.

  • How to use xcode to compile standard C prgram

    Hi all,
    I am a new developper in xcode. I have several standard C programs written by myself before.
    I have problem to open them with the new xcode (4.1 i guess). If I drag the program folder to xcode icon, nothing happens. I noticed through xcode I can start a new project or workspace, then I can add my program to it.
    However, problem still exists. e.g. my program contains several files (*.c *.h), if I select one variable and select go to the definition of it, xcode cannot find the definition.
    Besides I cannot debug neither run the program in xcode.
    Normally I compile my codes with gcc or icc in terminal, but now I am totally lost in xcode. I know my questions sound silly, hope some guys can help me out of it and I will appreciate a lot.
    Mono

    First, if you normally compile your code in the Terminal, you can keep doing that. You don't have to use Xcode.
    In Xcode 4 every program requires a project, even simple command-line programs. Create a command-line tool project. Choose File > New > New Project to create a new project. Select Application under Mac OS X on the left side of the New Project Assistant. Select Command Line Tool from the list of application projects. Click the Next button. Choose C from the Type menu. Name the project. Click the Next button. Select a location to save the project and click the Create button.
    After creating your project, add your source code files to the project. Choose Files > Add Files to ProjectName to add the files to your project. You may need to delete the main.c file Xcode created when you created the project.
    If you want to debug your project, click the Breakpoints button in the project window toolbar. Click the Run button in the toolbar to build and run your project. If you click the Breakpoints button, your program will run in the debugger. If you don't see the debug area at the bottom of the project window when running your program, choose View > Debug Area > Show Debug Area to show it. You need the debug area open to do command-line input and output in Xcode.

  • Using Xcode

    Hello! Um.. im kinda new to programming but since its gonna be my profession.. figured that Id start with Xcode. Um.. I wanna use Xcode to develop a widget that I can use to link to an HTML site. Is there someone with knowledge of Xcode or a site somewhere that I can use to walk me through this? Im willing to learn any Language so that I can make the widget. I only have some knowledge of HTML and MS-DOS but dos wont help me in mac and boo windows.

    I should start with Cocoa and Objective C first? Ok. I read a review on just a Cocoa book and the dude said you should have knowledge of C/C++. But thanks! I have a lil bit of knowledge with HTML (no idea what CSS is) and I haven't done anything with Javascript. I got a book on HTML so that would probably help me. A friend of mine gave me a project to try out on my Mac since Im new to it so Ive been experimenting with it. We play this game called Final Fantasy XI online and asked If I wanted to try to code a widget of a game timer. It would be something that works by syncing with your systems clock since ingame time runs differently. It would be used to tell you the ingame day, time, moonphase, shop times, etc. Eventually I wanna cross platforms to windows since ive used Windows most of my 18yrs of life lol! Maybe even linux but for now just Mac.. its such an awsome and stable OS I wish I used one before I started with 10.4 Tiger.

  • Programing serial port (USB) with xcode?

    Hallo,
    I am newbie in mac, and I want to program robot and accessing with serial port, I will use xcode and I'm a beginner on XCode.
    I'd like to build my own application now. Does anyone could send me any sample code?
    I'm using XCode 4.3.2 

    Here's a project I did a couple years ago for an iRobot Create.  It should still work with your setup.

  • Using Xcode for non-gui C++

    I originally posted this in the wrong place, and I was told to post in here.
    I am learning standard c++ in school, and we're programming with Microsoft visual Studio on PCs. I wanted to work on my projects at home, but I don't know how to create and build non-gui C++ projects. Anyone know?

    we're programming with Microsoft visual Studio on PCs
    If you want something like "Visual Studio" on Mac, then you can use the "Xcode" application in /Developer/Applications/. (I assume you have installed Xcode Tools, which is in your Leopard DVD).
    Start Xcode, and select "New Project..." from the "File" menu. In the Assistant dialog, open "Command Line Utility" and select "C++ Tool". Enter the name of the project and where to save it, and push Finish. Double click on "main.cpp", edit it, save (cmd-S), and push "Build" or "Build and Run". Is this what you want?
    Of course the project file is not comatible with Visual Studio, but you can copy the source files (*.cpp and *.h) to Windows PCs.
    If you prefer to run C++ compiler from the command line (rather than to use Xcode application), then just open Terminal.app (in /Applications/Utilities/), cd to the directory where the source files are, and try typing "g++ xxxx.cpp".

  • How can I read a serial port using XCode?

    Hello,
    I'm using an iMac 2009 with Mac OS X 10.6.7. I have a USB to Serial cable and I want to connect a hardware I made using a microprocessor Microchip PIC to my mac. I'd like to read values from the serial port and also write values to it. I'm already able to do this using the Terminal with the following command:
    screen /dev/tty.usbserial 9600
    I'd like to build my own application now. Does anyone could send me any sample code?
    I'm using XCode 3.2.5 and I'm a beginner on XCode.

    I looked at Dev Center for sample code, and I found this link:
    http://developer.apple.com/library/mac/#samplecode/SerialPortSample/Introduction /Intro.html%23//apple_ref/doc/uid/DTS10000454-Intro-DontLinkElementID_2
    I downloaded the sample Xcode project and, when I click on "Build and Run" button, it generates an error with the following message:
    "GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file SerialPortSample.c)"
    Maybe, it occurs because the code is too old (2005). I didn't find any newer sample.
    Could you help me?
    Thank you.

  • How to link individual picker view selections to download an individual file from a website or other location such as dropbox using Xcode?

    Alright, the question I have has to deal with how to link an app to a website to download files. How, or is it even possible to link individual picker view selections to download an individual file from a website or other location such as dropbox using xcode. Sorry if this is the wrong place to post this, but if anyone can help or can send a link to a place that can, I would greatly appreciate it!

    I am not getting anywhere with deploying my application or
    applet.
    I have set up my bc4j project. It contains all my VO info,
    links, application module. (proj a)
    I then have another project with DbInfo in it(has all my rowset
    info), Multiple Frames, and my Applet.java file.
    Actually I have an Applet.java file and a Application.java file
    because I was seeing if both/either worked. Anyway they seem the
    same, except for that extra window that comes up when you run the
    applet.
    I follow the steps in the oracle directions (from earlier post).
    And all seems ok. But at ---->
    [*] Select the subdirectory under myhtml where your applet's HTML
    file
    is located, and enter the directory path of the 'staging'
    directory you
    created in step 3 above, if different from the default.</li>
    [*]Select the HTML files that JDeveloper created to run your
    applet.</li>
    [*]Select all of the Java source files in your project that make
    up the
    applet.</li>
    I have no HTML file associated with my applet, at least that I
    know of.
    So do I need to create one, or should it of been done
    automatically.
    Also, I trying to figure out what will be the best way to deploy
    my project. Applet or stand alone application is what my first
    choices have been so far. I have read that there is some issues
    with applets being served from a different server than the
    database. So a stand alone application was my front runner, but
    I haven't gotten either way to work yet.

Maybe you are looking for

  • Using xml to load parameters in a dyn page

    hi, can anyone tell me how to get the parameters from an xml file to a dynpage? where to place the xml file in the portal application project structure?

  • Recapture issues

    Hi to all, I just lost all my media from a long conference. Was able to find the edit in th autosave vault but need to recapture the tapes, by using the batch capture command. I am having several issues, and could use a little guidance. i'ms sure thi

  • Why is my 6 plus rear camera taking blurry pictures?

    Rear camera was working great for months. Suddenly all pictures are blurry/fuzzy. No damage at all to iphone. Front camera is ok. Is there a software fix? I hope so because I'm thousands of miles from home

  • Desktop manager 6 USB connection problems with BB bold 9780

    Hello, I am running Windows 7 Home premium 64 bit on a DELL XPS 8100 PC. The latest version of the desktopmanager 6 is 6.2010 (Bundle 21). The desktop manager is not able to connect to my BB 9780 bold via USB. It short of partially connects to the de

  • Question about subclips in a long project

    Hello all;    I am editing a 1 hour long documentary in full HD with a lot of clips and so forth in it.  What I have been doing is for some segments creating a sequence in another project, rendering it and saving it as a H264 Full HD format, the same