C++ Development Tools


What are the tools you guys use for C++ development? To kickstart the discussion, I am initially looking for tools to navigate the MaidSafe code base efficiently.

Ideally, these should integrate with VIM and work on OS X.


Here you go copy and paste :slight_smile:


I should add this will automatically install a load of tools for you. You do need to compile one though so navigate to ~/.vim/vim-addons/github-oblitum-YouCompleteMe/ and then type ./install --clang-completer

This will work out what you are typing and also real time compile and check any code. In vim F4 will show tags etc. and F5 will show a file browser \p will do a fuzzy search on files in the project (much faster than searching through a tree based filelist) and more. In your project root dir create and empty tags file (called just tags) and this will auto update tags and let you navigate around very fast. Folding is enabled (fast nav) just press the spacebar on a fold and it unfolds, or on a function to fold it. type zi to switch folds on/off

It’s all hard going but remember some of this and you will fly through code and have what you write automatically checked and compiled with all the functions tagged and searchable very fast. Use things like j] to jump to definitions/declarations and so on. With all this the speed you will get up to will amaze people and allow super quick efficient coding. There is also an inbuilt debugger if you have lldb installed (need to uncomment that line in vimrc).


I will assemble a tutorial with this and the maidsafe dev environment when I get back from lunching; The .vimrc is amazing; I used the past 2 hours figuring out how to compile YouCompleteMe; It is certain each that you mention about increasing speed;

+not needing to memorize everything; I haven;t tried yet, will it autocomplete maidsafe libraries?


It does very well. Please search for any dirvine and change the paths there to suit yourself. I keep this update with a bunch of other helpers on github, including the https://github.com/dirvine/dotfiles/blob/master/Devel/MaidSafe/.ycm_extra_conf.py that shoudl go in the project root as well as https://github.com/dirvine/dotfiles/blob/master/Devel/MaidSafe/.syntastic_cpp_config to make it all even faster. Don’t forget to create a tags empty file in the root as well :wink:


is this folder a replication of your environment?


It is, although it changes a bit. The awesome and vim setup are the goto parts for me. Makes it very fast to move around.


My colleague showed me “selecta” by Gary Bernhardt, a commandline fuzzy selection tool which can easily be used in bash scripts and commands:


It can be integrated in VIM in the following way (look at the end of the vimrc file):


It uses ‘ag’ a much faster replacement for ‘grep’ and ‘find’. On the MaidSafe entire code base, there is a slight delay, but it is still acceptable.


Something else


@dirvine can you please help with this, i just udated my ubuntu and i got this
W: Duplicate sources.list entry http://dash.maidsafe.net/repos/apt/ubuntu/ trusty/main i386 Packages (/var/lib/apt/lists/dash.maidsafe.net_repos_apt_ubuntu_dists_trusty_main_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems


It’s just that you have this listed twice. If you edit the list it should be fine.

sudo gedit /etc/apt/sources.list

remove the last line (I think it will be the last one, it is the duplicate line that contains http://dash.maidsafe.net/repos/apt/ubuntu/ trusty/main

then run

sudo apt-get update


ok thanks, i will do just that.


these are 404 atm


Sorry I changed my repo name (we are all on forks now to be the same as all devs).
So here it is





clang vs g++

These are two compilers;
clang does the same thing as g++;
Which is better to use;
it was straight forward to build maidsafe and run the test;
Actually super easy.

within build_maidsafe from the

make local_network_controller


also cmake 3.0.2 vs cmake 2.8


I’m sure this all looks crazy to a new comer;
I’m sure that it will all make perfect sense and be a nice roadmap once you are familiar with linux;


I use both compilers for max errors etc. I find clang is my goto though.

In terms of cmake, 3 is better but not yet supported on enough systems (CI, remote machines etc.) which means building. Building is easy, but not always possible in things like drone.io or codeship.io given time constraints. We would love to move to 3, but it imposes to many issues on devs and systems right now. It was a pretty huge debate in house as it does offer features we can really make great use of, but just too bleeding edge right now :frowning: