Skip to content

Instantly share code, notes, and snippets.

@elinx
Last active February 4, 2018 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elinx/610253cde620d72281be42e5c82d0b2d to your computer and use it in GitHub Desktop.
Save elinx/610253cde620d72281be42e5c82d0b2d to your computer and use it in GitHub Desktop.
spacemacs for c/c++ trouble shooting
  • clang completation don't work after enable c-c++ layer. see the message buffer and found that clang exectuable can't be found, use the following commands:
sudo ln -s /usr/bin/clang-5.0 /usr/bin/clang
sudo ln -s /usr/bin/clang++-5.0 /usr/bin/clang++
  • snippets can't pop up after enable auto-complete layer, search the .emacs.d directory and found no snippet files at all, solve this by downlaod snippets manual use the following commands:
cd ~/.emacs.d/elpa/yasnippet-20180111.1533/snippets
git clone https://github.com/AndreaCrotti/yasnippet-snippets.git
  • I programme in c++ most of the time, c++ headers can't be auto-completed after adding c-c++-default-mode-for-headers 'c++-mode) to the c-c++ variable. Solve this by modifying funcs.el(not a fancy way, but solve problem anyway):
      (setq-local company-c-headers-path-system (append '("/usr/include/c++/5/" "/usr/include" "/usr/local/include") dirs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment