

Ask HN: Modern C++ development setup? - ekuality

I&#x27;m looking to get into C++ development and I&#x27;m looking for recommendations for tooling and best practices. My machine is a Macbook Air. I pick up new tools pretty fast so don&#x27;t necessarily shy away from advanced setups.<p>For starters I want to be able to compile OpenCV (an open-source C++ program: https:&#x2F;&#x2F;github.com&#x2F;Itseez&#x2F;opencv) on my mac, and I&#x27;m not even sure where to begin with compilers, build and dependency management, etc. Is G++ the right tool to be using, or is there something else?<p>Aside from being able to compile OpenCV I&#x27;m also looking for general best practices for modern C++ development (particularly on a mac). Compilers, tooling, dependency management, etc. Any tips, tutorials, articles, you have would be very helpful.<p>My background is mostly on the JVM (Java, Scala) with some Node, Ruby, Python, etc.
======
adadabase
Looks like OpenCV is using CMake:
[http://www.cmake.org/](http://www.cmake.org/)

Here's my setup: Vagrant
[http://www.vagrantup.com/](http://www.vagrantup.com/) Clang
[http://clang.llvm.org/](http://clang.llvm.org/) Chef cookbooks for
dependencies (like Clang)

Vagrant makes standing up a development virtual machine easy and repeatable. I
prefer clang to gcc primarily for the (IMO) superior error messages. But, the
"YouCompleteMe" plugin for Vim is a very nice additional benefit to using
clang.

I would also recommend reading up on some of the changes to the language made
in C++11 - the support for lambdas, for example, is wonderful.

Finally, with the latest version of Vagrant there is support for Docker
containers, [https://www.docker.io/](https://www.docker.io/) This holds a lot
of promise. I'd recommend looking at that, too, as a way to build the
development environment and required libraries once, in addition to using Chef
for provisioning... think of docker as a shortcut to provisioning that can
also be used in deployment...

~~~
adadabase
Oops, I forgot to mention a few things... Builds: Waf -
[https://code.google.com/p/waf/](https://code.google.com/p/waf/) Unit Testing:
googletest -
[https://code.google.com/p/googletest/](https://code.google.com/p/googletest/)
waf tool for googletest - [https://github.com/tanakh/waf-
unittest](https://github.com/tanakh/waf-unittest) Logging: glog -
[https://code.google.com/p/google-glog/](https://code.google.com/p/google-
glog/) Command line flags: gflags -
[https://code.google.com/p/gflags/](https://code.google.com/p/gflags/)
Batteries (ala Python's batteries included) -
[http://www.boost.org/](http://www.boost.org/)

Finally... I've started looking at hayai for benchmarking since it's based on
googletest's design:
[https://github.com/nickbruun/hayai](https://github.com/nickbruun/hayai)

