Saturday, February 9, 2013

C++ setup

Being as I'm using a Mac, I figure I should be able to get plenty of mileage out of Xcode. So I do the following:

  • Install Xcode (version 4.6)
  • New Project...
    • STL C++ Library
    • Product Name: cookbook
    • Type: Standard Dynamic
    • X : Use Automatic Reference Counting
    • Do NOT create local git repo (want it on github instead)
    • Click the play button (which apparently means build): Build succeeded.
  • Enable developer mode? Yes

I've learned languages in the past using other methods, but by far the best experience I've had is with C#:

  1. (Figure out how to write a test)
  2. Write a test
  3. Figure out how to make the test pass
  4. Go back to step 2, rinse repeat
So, that means I'll need a test framework. For my purposes, I've chosen google test, aka gtest, aka Google Test for C++. So, even though I don't even know how to make my program run (command-R button still disabled), I'm going to start by trying to bootstrap gtest into a working test framework for some as-yet-unwritten toy program…

No comments:

Post a Comment