Visual Studio 2010 C++

Discussion in 'Mac Programming' started by Epic Xbox Revie, Feb 10, 2011.

  1. Epic Xbox Revie macrumors 6502a

    Epic Xbox Revie

    Joined:
    Jun 15, 2010
    Location:
    Washington, D.C.
    #1
    Hi, I use Microsoft Visual Studio 2010 at school. I was wondering what the best program to do basic c++ coding and compiling would be? Preferably free. It's just so I can work on the programs at home, which I don't have to do, but I want to. Thanks
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    For a full IDE: XCode. On a DVD that came with your machine, or register for free and download, http://developer.apple.com.

    For command-line tools:
    Any text editor, g++, gdb
    Text editors are widely available, the rest installs with XCode

    -Lee
     
  3. danwilliams macrumors member

    Joined:
    Sep 15, 2008
    #3
    If you can get Microsoft Windows and Visual Studio for a price you can afford, you may want to consider installing Windows plus Visual Studio via VirtualBox. This way your development environments will be the same between school and home.

    However, learning two different development environments on two different platforms is not a bad thing if you can handle the learning curve. And it looks good on a resume!
     
  4. torbjoern macrumors 65816

    torbjoern

    Joined:
    Jun 9, 2009
    Location:
    The Black Lodge
    #4
    For free? As far as I can see, it costs $99 per year to be in the dev program.
     
  5. McGordon macrumors member

    Joined:
    Dec 28, 2010
    Location:
    Scotland
    #5
    Xcode is "free" (if you have a Mac and OS X).

    Either install it from the Mac OS X install DVD, or download it with a free account here:

    http://connect.apple.com/
     
  6. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #6
  7. danwilliams macrumors member

    Joined:
    Sep 15, 2008
    #7
    It looks like Xcode 3 is a free download. http://developer.apple.com/technologies/tools/

    Edit: Oops! My bad. Others beat me to it...
     
  8. flyingturtle macrumors regular

    Joined:
    Apr 7, 2010
    #8
    Yeah, like others have said, Xcode, is free to download and use.

    But the full version of Microsoft Visual Studio 2010 (and other MS development tools) is also free for students via the DreamSpark program.

    See here:
    https://www.dreamspark.com/default.aspx

    You can run that on your Intel Mac with bootcamp. It might more preferable if you are using VS 2010 at school, too. Then you can just take your VS 2010 project file home with you.
     
  9. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #9
    Keep in mind that code you are writing for the MS platform may not be compatible with another platform such as OS X. It would depend on if you are writing specific MS dependencies of course.

    That DreamSpark program sounds like the right way to go. Also Microsoft has Visual Studio Express for free. I would think the source code would be compatible between that and the pro version. Maybe I should say, I'd hope. Of course for these solutions, you'd need a copy of Windows running on your Mac either via a virtual machine or by booting via Bootcamp.
     
  10. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #10
    I'm not really one for black-helicopter, tinfoil-hat, illuminati-style conspiracy theories, and this may come off like that... but corporations exist to make their shareholders money. How does this DreamSpark (is the dream more of a software monoculture nightmare?) program do that? I would bet that the goal is to ingratiate their tools to the devs of tomorrow so they are reliant on, familiar with, and tightly bound to MS tools and platforms. I would say that unless your course is MS-geared requiring DirectX or other MS-specific technologies, write your C++ on Linux or OS X as well as on Visual Studio on Windows. You will be a better, more well-rounded programmer for doing so.

    I always specifically recommend learning to compile, run, and debug from a command-line. Knowing how to press the magic button that compiles your code, runs it, and magically stops on the line you clicked on in two different IDEs, meaning you can work in those two programs is less valuable in my mind than the versatility of knowing how to do that on the command-line of any machine that isn't windows you come across. To a lesser extent I recommend learning a terminal editor like vim, but that can be a tall order for new programmers.

    Honestly, just do what works for you. Just know there are broader horizons beyond visual studio.

    -Lee
     
  11. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #11
    Bizspark is the same thing for software start-ups. Microsoft the crack dealer. Here's a free taste. http://www.microsoft.com/bizspark/

    At least the free Visual Studio Express tools are a bit less limited than they have been in past versions. You still can't target 64 bit out of the box or use MFC or ATL, but at least you get an optimizing complier now.

    B
     
  12. burke e macrumors newbie

    Joined:
    Feb 16, 2011
    Location:
    Hades
    #12
    I am in the OP's same situation

    I am a student to... Brand new student, I don't know ANYTHING.
    I find all the jargon on these forums confusing to say the least.
    Basically my coding ability is adding two numbers and press any key to continue. BASIC, BASIC stuff - I barely grasp the concept

    Is anyone willing to fill in the holes for me?

    we use visual studios at school too - C++

    I registered like post #2 suggested (as an apple developer) and I am in the process to downloading XCODE

    all I need is a way to build very simple programs, and compile them, see if they work

    C++

    I need cpp code file and an exe file for my assignments

    but ultimately I need to learn how to write the code and see if it works

    a plus would be me being able to do it all at home on my mac

    Besides Xcode what else do I need to do/know to program little crap programs, run them, see if they work and then beable to provide the teacher with the files he wants?

    ANY HELP IN IDIOT SPEAK AND DETAIL would be GREAT,,, I am lost - thanks in advance!!!

    B
     
  13. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #13
    Read this other thread and make Hello World work. For most basic purposes that's all you need.
    http://forums.macrumors.com/showthread.php?t=1090449

    g++ installed via Xcode, a text editor of your choice and Terminal.app

    If you don't understand jargon you need to be more specific, we can't tell what you get or don't get.

    B
     
  14. Blakeasd macrumors 6502a

    Joined:
    Dec 29, 2009
    #14
  15. burke e macrumors newbie

    Joined:
    Feb 16, 2011
    Location:
    Hades
    #15
    Thanks, OK I download Xcode -

    Will it install on its own?

    After installation I open Xcode, how do I get to programming?

    I don't understand what a text editor is, it sounds like an additional program

    and

    I don't understand what a terminal app, it also sounds like additional program

    If so where can I download them?

    After I get/have a text editor + terminal app

    How do I use those in conjunction with Xcode

    Finally, what is the purpose and function of these three things

    Xcode

    text editor

    terminal app

    Which one do I type the code into?

    Which one compiles/debugs the program?

    You see, I am so ignorant I am virtually a newborn -

    I really would like to learn, but my foundation is relative to the program we use in school. My ability to use that program is based upon following steps
    1 through 10 - not an actual understanding of how I set the "stage" to input the code itself.

    At school my steps are -

    1 Launch Microsoft Visual Studios

    2 Click "new project"

    3 Click visual C++

    4 Click WIN 32 Console Application

    5 Name project

    6 Go to "project"

    7 Click new project

    8 Add cpp file (blank)

    9 I type in my program

    10 debug or compile next???

    thats what I know

    I understand the language, but I do not understand the set up and the step to
    execute the finished program.

    Thank you for your time

    B
     
  16. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #16
    XCode is an Integrated Development Environment (IDE) like Visual Studio. It allows you to create a project, enter and edit code, compile code, run the resulting executable, and debug the resulting executable. The suggestion of a text editor and the use of Terminal for compiling/running/debugging is an option instead of, rather than in addition to, XCode. You would still need to download and install (installation will be a separate step) XCode in order to get the programs (such as the compiler g++ and debugger gdb) installed that you would need for the Terminal/Text editor approach mentioned.

    Terminal is an application already on your Mac that allows you to interact with your machine using text commands. You do so using a shell, which accepts text commands, issues them to the system, and allows you to interact with the program being run. You would probably want to download a text editor such as TextWrangler or Smultron separately, as the console editors available are often overwhelming for a beginner. You would enter and save your code from one of these text editors, then issue a command from Terminal to compile the code, then another to run your code. if you needed to use a debugger, you would also start this from the terminal. This would differ from the approach of XCode or Visual Studio, where you do all of this from within a single program. Which is better is a personal preference and you may need to evaluate which suits your learning style.

    It is probably best that you wait until XCode has finished downloading and installing before asking further questions, because a lot of things depend on you having the tools it will installed available. Once you have done so if you have problems post again with what specifically you are having trouble with.

    -Lee
     
  17. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #17
    Xcode downloads as a DMG disk image. Double click on it to mount it and read the docs on how to install it.

    Once you have it installed:
    1. Launch Xcode
    2. Create New Xcode Project
    3. Select Mac OS X Application -> Command Line Tool -> C++ stdc++
    4. Name and locate your project
    5. Edit main.cpp, enter your code.
    6. Click Build and Run (or build and debug if break points are on).

    However, I encourage you to learn how to do all of this without the "help" of the IDE as described in the thread I linked.

    Terminal is included with OS X, it is equivalent to CMD.EXE (a.k.a. "Command Prompt") on Windows.
    OS X comes with various editors pre-installed that you can use within Terminal, vi, emacs, nano, as well as a GUI editor TextEdit. There are also many third party programmer's editors like the free TextWrangler or Fraise. (EDIT: Lee beat me to the second part of this).

    B
     
  18. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #18
    Are you doing Windows programming or just general C++? If this is just standard C++ you can use what ever tool you want. I would use a text editor, terminal and make, if not, just use Xcode. Keep in mind though that you will not be able to just double click you saved project, but you need to re-import all source files. Shouldn't be too much trouble though if this is your first C++ course.
     
  19. burke e macrumors newbie

    Joined:
    Feb 16, 2011
    Location:
    Hades
    #19
    You guys are legends in my book!!!

    Really appreciate the good will guys.


    I have about 4 decades, 6 years and three days until this download is complete
    (Xcode) :D

    I will be back as soon as I see where I am deficient.
     
  20. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #20
    Did we mention that the version of Xcode that was current when your Mac was shipped is on that second grey disc that came with your Mac labelled "Optional Installs"?

    B
     
  21. burke e, Feb 16, 2011
    Last edited: Feb 16, 2011

    burke e macrumors newbie

    Joined:
    Feb 16, 2011
    Location:
    Hades
    #21
    'Crap - OK I installed the other DVD "applications install DVD" the second one I got with the rig
    Now I can't find my "hard drive" it went poof and disappeared, also search my applications
    and could not find xcode after the new install was complete - I am dangerous, look out now!!! :D

    God save the Queen
     
  22. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #22
    Xcode installs in /Developer/Applications not /Applications.

    In Finder, Go -> Go To Folder -> /Developer/Applications. Or just use Spotlight and search for Xcode.

    B
     
  23. burke e, Feb 16, 2011
    Last edited: Feb 16, 2011

    burke e macrumors newbie

    Joined:
    Feb 16, 2011
    Location:
    Hades
    #23
    Could not find Xcode on anywhere on my computer after inserting the second disk.

    downloaded Xcode from Apple developers

    Took five hours +


    Followed the install

    tried to launch and "Xcode cannot be opened because of a problem"

    Problem Report for Xcode

    What do I do now???

    It has installed many other things that work fine and I will never use

    lists of things... 7GB more than it said it would be

    Can I just keep what I need? and make that work?
     
  24. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #24
    Repair permissions and try to reinstall from the download.

    Take a deep breath and if that still didn't work, go back and try the non-IDE approach from the thread I linked above.

    g++ is probably working fine.

    B
     
  25. Hansr macrumors 6502a

    Joined:
    Apr 1, 2007
    #25
    Which OS version do you have, might wanna check software update to make sure you're up to date?
     

Share This Page