Skip to content

Instantly share code, notes, and snippets.

@DennisOSRM
Last active August 29, 2015 14:15
Show Gist options
  • Save DennisOSRM/f07e63d7dea5aa00efef to your computer and use it in GitHub Desktop.
Save DennisOSRM/f07e63d7dea5aa00efef to your computer and use it in GitHub Desktop.
SublimeText3 and SublimeClang
  • Install and build SublimeClang into the packages folder of ST3
git clone --recursive https://github.com/quarnster/SublimeClang SublimeClang
cd SublimeClang/
git pull && git submodule foreach --recursive git pull origin master
cp /path/to/llvm/Release/lib/libclang.so internals/
cd src
mkdir build
cd build/
cmake ..
make
  • restart ST3

  • go to menu: Tools->Command Palette...->Preferences: SublimeClang Settings - User

File should be empty on a fresh install. Add the following with paths adapted to what your environment

{
    "options_script": "python /home/dennis/Coding/Project-OSRM/cmake/cmake_options_script.py /home/dennis/Coding/Project-OSRM/build/compile_commands.json",
    "options": [
        "-Wno-unused-command-line-argument", 
        "-Wno-unknown-pragmas", 
        "-std=c++11",
        "-I/home/dennis/Coding/Project-OSRM/ThirdParty"
    ],
    "hide_output_when_empty": true,
    "reparse_on_activated": true,
    "reparse_on_save": true
}

The CMake options script-parsing the json compile DB- can be found here.

  • if this error occurs: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/cstddef:51,11 - Error - no member named 'max_align_t' in the global namespace

Then edit /usr/include/c++/4.9.1/cstddef. Path may vary depending on error message.

Add a define around the following line:

  using ::max_align_t;

to look like this:

#ifndef __clang__
    using ::max_align_t;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment