Sublime Forum

Sublime Text 3 SublimeClang cygwin mingw 64bit


Took me a little while to get this setup. So I figured I would document it for everyone else (and my future self).

I run mingw in cygwin to compile my code. The following is what allowed me to use the SublimeClang plugin in this setup.

First follow this: Install Sublimeclang on ST3 (windows)
Make sure to use the proper download link I replied with to get the SublimeClang release with the libclang files. I copied the following four files (because I use 64bit dev tools):

  • libcache.dll
  • libcache_x64.dll
  • libclang.dll
  • libclang_x64.dll

Also don’t bother with the specified code change because it’s already been implemented in the code you checkout from the git repo.

At this point a restart of Sublime Text appeared to at least get the plugin running, but with a ton of errors about not being able to find things like ‘string’. The hardest part was getting all the include directories setup right, so I’m going to include my setup here in hopes you’ll benefit.

in the project.sublime-project file add a "settings" section like this:

        "-isystem", "C:\\<path to base cygwin64 folder>\\usr\\x86_64-w64-mingw32\\sys-root\\mingw\\include",
        "-isystem", "C:\\<path to base cygwin64 folder>\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2",
        "-isystem", "C:\\<path to base cygwin64 folder>\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2\\include",
        "-isystem", "C:\\<path to base cygwin64 folder>\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2\\include-fixed",
        "-isystem", "C:\\<path to base cygwin64 folder>\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2\\include\\c++",
        "-isystem", "C:\\<path to base cygwin64 folder>\\lib\\gcc\\x86_64-w64-mingw32\\4.9.2\\include\\c++\\x86_64-w64-mingw32",

I hope that helps someone else struggle a little less.
Obviously things like the gcc version and your particular compliler version in the paths will change, but this is what worked for me.