Programming C++ without XCode

Discussion in 'Mac Programming' started by Lumio, Aug 19, 2009.

  1. Lumio macrumors member

    Joined:
    May 20, 2008
    #1
    Hi,

    I'm really used to TextMate. So I thought of learning C++ with TextMate. Would you recommend it, and if so, how to compile programms written with TextMate?

    Greetings
     
  2. uberamd macrumors 68030

    uberamd

    Joined:
    May 26, 2009
    Location:
    Minnesota
    #2
    To compile you would likely need to do it by hand using gcc. I wouldn't recommend TextMate personally, as I prefer an IDE like XCode or Netbeans (both free obviously) because they have features like auto complete, etc. Its possible, but I don't suggest it, especially to learn the language.
     
  3. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
  4. uberamd macrumors 68030

    uberamd

    Joined:
    May 26, 2009
    Location:
    Minnesota
    #4
  5. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
    #5
    Can I use NetBeans out of Box? So I don't need to configurate it? Let's see (in one minute, when it's finished)
     
  6. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
    #6
    Sorry for double post... :)
    Well, NetBeans is nice, but I have a general question....
    What's the header-file for? I mean, when I create a new cpp-file, it adds me also a new .h-file. For what?
     
  7. uberamd macrumors 68030

    uberamd

    Joined:
    May 26, 2009
    Location:
    Minnesota
    #7
    You have a long road ahead of you my friend. Any good programming book or tutorial on C++ should explain header files in depth. They are useful, and important. C++, Objective-C, and many other languages use header files of some sort.

    Wikipedia: "A header file commonly contains forward declarations of classes, subroutines, variables, and other identifiers. Programmers who wish to declare standardized identifiers in more than one source file can place such identifiers in a single header file, which other code can then include whenever the header contents are required."
     
  8. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
    #8
    And what then contains the cpp-file?

    I know I have a long and hard road on my way :D but I want to pass it.
     
  9. uberamd macrumors 68030

    uberamd

    Joined:
    May 26, 2009
    Location:
    Minnesota
    #9
    Think of the header file as a blueprint for your methods, and in the cpp file you take that blueprint and fill in the guts of the methods.
     
  10. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
    #10
    So for example I have one cpp file and there I put in the real code, what the functions and so on are doing? and in the header files I say, that those functions exists?
     
  11. notjustjay macrumors 603

    notjustjay

    Joined:
    Sep 19, 2003
    Location:
    Canada, eh?
    #11
    That is correct.
     
  12. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
    #12
    Okay, than I understand :)

    Nice support here :D thx guys
     
  13. benlangdon macrumors 65832

    benlangdon

    Joined:
    Jan 13, 2008
    #13
    personally i think you should try using eclipse.
    eclipse is used by everyone on every platform and can handle all types of code.

    i use it at school and my teachers use it at school and at work ( ibm ).

    personally i like xcode though. why don't you want to use xcode?

    i have my c++ book in digital version if you want it.
     
  14. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
    #14
    Hm, what is the big difference between Eclipse and NetBeans?
     
  15. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
  16. benlangdon macrumors 65832

    benlangdon

    Joined:
    Jan 13, 2008
    #16
    i dunno.
    never heard of netbeans really.

    o but for some weird reason if you use eclipse, you have to install xcode.
    you don't have to use it or anything but its weird. maybe im wrong
     
  17. uberamd macrumors 68030

    uberamd

    Joined:
    May 26, 2009
    Location:
    Minnesota
    #17
    Both are IDE's, use whichever one works best for you. Netbeans just released a new version a few months back which I love. Personally, I (and my co workers) prefer Netbeans over Eclipse.

    Suuure. Wait until you get into advanced topics.

    Try it before ya knock it.
     
  18. benlangdon macrumors 65832

    benlangdon

    Joined:
    Jan 13, 2008
    #18
    ya if you understand pointers right away, this is def your profession :p
     
  19. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
    #19
    I think pointers are the same as referenzes in PHP. If so, it's really usefull.
    My problem is, that I have a running project beside my office work. :|

    //edit:
    I added a new class with NetBeans, and beside the normal constructor, it created to other constructors:
    Code:
    NewClass::NewClass(const NewClass& orig)
    and
    Code:
    NewClass::~NewClass()
    What does the parameter in the first one mean and what does the ~ in the second one do?
     
  20. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #20
    Google for "copy constructor" and "destructor".
     
  21. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
  22. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
    #22
    I think this thread is going to get to a personal c++ training and some support for IDEs xD I hope that's no problem :D

    well I have a little style problem with eclipse... it "selects" me all used elements. So, when I click into a variable it highlights every other variable. The problem now is, that the background color of this highlightning is too bright. (see the attachment)

    I looked up the settings, but I couldn't find the option to change or disable this.
     
  23. benlangdon macrumors 65832

    benlangdon

    Joined:
    Jan 13, 2008
  24. Lumio thread starter macrumors member

    Joined:
    May 20, 2008
    #24
    Sorry...
    [​IMG]
    You can see, line is in a light grey. How to change that?
     
  25. benlangdon macrumors 65832

    benlangdon

    Joined:
    Jan 13, 2008
    #25
    what line?
    to be honest i have no idea.
    eclipse sometimes has this highlighting thing that it does when you i think triple click, where it lightly highlights everything that is the same thing.
    if you just click off it should go away.
    i think.

    is this a screen shot? or a pic of the screen (camera)?
    looks weird.
     

Share This Page