Results 1 to 10 of 10
  1. #1


    Member Since
    Dec 27, 2007
    Posts
    27
    just started c++ xcode help
    hey people im in grade 12 and just a few days ago we started c++
    at school we use dev++ and it seems pretty easy.. type your code.. compile and run..

    i downloaded xcode tools and it seems very complicated.. i did create new c++ and i can type the code but there are no options to compile and run it.. why?

  2. #2


    Member Since
    May 10, 2007
    Posts
    17
    Are you looking to specifically compile GUI applications or just work on your programming stuff from school on your Mac?

    If the latter, you can easily do this without having to mess with Xcode (which can be daunting for someone just getting into programming).

    Just open up any old text editor (I like Simultron on Mac) and write your code, then save it. Open a Terminal window, navigate to where you saved your filed, and then type:

    g++ filename.cpp

    That should produce an a.out binary that you can run by typing ./a.out

    I'd play around with plain old text based C++ a lot before getting deep into GUI programming. I'm still not very good with Xcode myself, but I have done GUI development for Windows on Borland C++ Builder and having the plain-jain background foundation in place helped a lot there.

  3. #3


    Member Since
    Dec 27, 2007
    Posts
    27
    i simply want to work on my school projects on my mac.. we learned the language Turing for two years and then the final year of highschool we moved to c++..

    its simple stuff like

    cout >> "enter a number";
    cin << number;


    i was hoping xcode can be a nice alternative for dev++ but i guess its not?
    i'll try that method and i'll update you later if it works

    by the way is there a built in text editor on the mac? i know there's textedit but thats more like a word style application.. im talking pure 'notepad'

  4. #4

    RNDdave's Avatar
    Member Since
    Sep 04, 2006
    Location
    London, UK
    Posts
    1,063
    Specs:
    MacBook Air | iPad | iPhone | iPod Classic | iPod Shuffle | no more money
    Textedit is pretty good for simple text and a little bit more. Smultron is a pretty cool free app thats prob worth the download.

  5. #5


    Member Since
    Dec 27, 2007
    Posts
    27
    alright

    also.. i opened terminal for the first time and how the heck do i navigate through it

    im a new mac user.. i tried to type DIR to see all directories and but that doesnt work..

    my file is located on my desktop so i somehow need to reach it

  6. #6

    RNDdave's Avatar
    Member Since
    Sep 04, 2006
    Location
    London, UK
    Posts
    1,063
    Specs:
    MacBook Air | iPad | iPhone | iPod Classic | iPod Shuffle | no more money
    to change directory the command is cd
    to view the contents then the command would be ls
    to view where you are type pwd

    If you type man ls you should get the full list of options available to you and what they mean.

    When you open the terminal it should default to your user area so just typing cd desktop should be all you need to get to the desktop

    EDIT: a quick Google search brought up a page with plenty of commands for you to play with in the terminal terminal commands

  7. #7


    Member Since
    Dec 27, 2007
    Posts
    27
    thank you very much! now i can view my program..it works

    thanks again

  8. #8

    chat19's Avatar
    Member Since
    Aug 09, 2007
    Posts
    115
    Specs:
    MacBook Pro 2.4 GHz, 160 gig HDD @ 5400, 2 gig RAM, nVIDIA 8600
    nice, but complex
    "We, the Chinese people, draft the entire Woo-Tang Clan!"

  9. #9


    Member Since
    Mar 25, 2008
    Posts
    1
    I'm doing the same thing, but when I type

    g++ TestC2.cpp

    I get an error:

    TestC3.cpp:3: error: 'cout' was not declared in this scope

    What am I doing wrong?

    Here's my code:

    int main ()
    {
    cout << "Hello World.";
    return 0;
    }

    Edit: Just fixed it. Accidentally erased #include <iostream>

  10. #10


    Member Since
    Mar 27, 2008
    Posts
    18
    If anyone's still following, the Terminal runs a brand of Unix (which one depends on how your computer is configured). Any basic primer on using a Unix command line will explain how to "use" the terminal.

    Also, there's a great editor included with the terminal called Emacs, type "emacs" at the prompt to start it up. If you are patient and willing to read the manual you can figure out how to write and compile code all from the same window.

    Good luck!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Getting Started ...
    By SonjaSeki in forum Apple Notebooks
    Replies: 1
    Last Post: 11-19-2013, 01:32 PM
  2. Getting started?
    By ebner19 in forum Apple Desktops
    Replies: 1
    Last Post: 01-23-2013, 12:35 PM
  3. Getting started with Xcode , problems with push segues
    By danib in forum iOS Development
    Replies: 3
    Last Post: 12-06-2011, 07:58 AM
  4. Xcode stopped letting me run Xcode app on iPad
    By ildsarria in forum iOS Development
    Replies: 1
    Last Post: 11-09-2011, 03:15 PM
  5. getting started with Xcode
    By psylovibe in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 12-12-2009, 10:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •