xcode/c++ HELP plz :-(

Discussion in 'Mac Programming' started by ellevy12, May 5, 2007.

  1. ellevy12 macrumors newbie

    Joined:
    May 5, 2007
    #1
    hello. i am new to the mac and was doing c++ h.w. under dev cpp in the windows.

    now i am trying to figure out xcode and it's really bad :-(

    i had this project i was doing under dev cpp and i created a new , empty project in xcode, and dragged all the cpp and header files to the mac.

    i tried to build and run it , but it won't work.

    i sew that i need to build/make some target, but i dont know what it is and what should i make. i need somthing that runs to the command line like in windows, for a simple c++ course i am taking.

    please help !

    Elad.
     
  2. kpua macrumors 6502

    Joined:
    Jul 25, 2006
    #2
    Don't choose "Empty Project"
    in the New Project setup. Choose "C++ Tool"
     
  3. peterjhill macrumors 65816

    peterjhill

    Joined:
    Apr 25, 2002
    Location:
    Seattle, WA
    #3
    Xcode
    file menu
    new project
    command line utility
    c++ tool

    start there
    i'm not an SDE, so that is about as far as I can take you.

    Peter
     
  4. krisvdc macrumors newbie

    Joined:
    May 5, 2007
    #4
    Add your files by : Project -> Add to project.

    And try not to overwrite the main.cpp, you beter copy paste your other main.cpp in it.

    Don't forget to disable the Build -> Allow zeroLink, when i started out with xcode, that caused some freaky results.

    Regards,

    Kris
     
  5. ellevy12 thread starter macrumors newbie

    Joined:
    May 5, 2007
    #5
    what does the zero link means ??

    thanx for the advice guys, it helped, tough i am wondering what the targets means.


    do you know of other programs such as Xcode (and more like the nice easy dev c++) for programing c++ under mac os x ?
     
  6. krisvdc macrumors newbie

    Joined:
    May 5, 2007
    #6
    zerolink : http://developer.apple.com/document...en.lproj/bs_linking/chapter_34_section_9.html You don't really need to know what it is. It just ****ed up my c apps.

    I also code with vim and Makefile on other *nix-es. That's nice and easy ;)

    Targets :

    I made a new "Command Line utility" -> "C++ tool" with the name qdsf
    I change the "active build configuration" to "release", and "build and go"

    If I click on the qdsf executable in the project and "reveal in finder" i found a path like /User/kris/qdsf/build/Release/qdsf
    I cd to that in terminal and :

    pearl:~/qdsf/build/Release kris$ ./qdsf
    Hello, World!

    All done :)
     
  7. ellevy12 thread starter macrumors newbie

    Joined:
    May 5, 2007
    #7
    OK
    and what does building config means?
    in dev c++ i only clicked on build and relexed.
    what is the diffrence beatwean release and the other?

    thanX guys
    Elad
     
  8. peterjhill macrumors 65816

    peterjhill

    Joined:
    Apr 25, 2002
    Location:
    Seattle, WA
    #8
    (again, not a developer)

    I super highly recommend that you check out textmate. I have been using it August 2005. It is a very powerful text editor. I like it much better than bbedit.

    http://www.macromates.com/

    It might not replace the editor in xcode, but I know a number of former vi and emacs users that are using textmate.
     
  9. aaronbrethorst macrumors member

    Joined:
    Feb 1, 2007
    Location:
    Seattle, WA
    #9
    I'll echo Peter's comments. TextMate is fantastic, and you may be much better off with it than an IDE. I love IDEs, don't get me wrong (especially having worked on one for the past three years), but they can get in the way when you're just learning how to program.

    Good luck!
    Aaron
     
  10. AussieSusan macrumors member

    Joined:
    May 29, 2006
    Location:
    Melbourne, Australia
    #10
    Take the time to learn about Xcode

    As you are finding out, Xcode is NOT Visual Studio.

    While not a solution to your immediate problems, I strongly suggest that you get one of the books available on developing under Xcode. These (typically) take you through the various steps and describe the purpose of the sources 'folders', targets, executables etc..

    Once you get the hang of the various concepts built into Xcode, then you will be able to do a lot with it, but my experience is that it has a fairly steep learning (or familiarity) curve. It can do everything I want it to, but i needed to learn how to talk to it in the way it was expecting.

    Taking a bit of time now will same you heaps of frustration later on.

    Susan
     
  11. lorductape macrumors 6502

    lorductape

    Joined:
    Jun 23, 2006
    Location:
    t3h usa
    #11
    or you could do what i did and get crossover mac and run devC++, arguably the best free compiler there is.
     
  12. Mr.Texor macrumors regular

    Joined:
    Apr 20, 2007

Share This Page