Sublime Text 3 and EasyClangAutocomplete


#1

I’ve set up a build system for OF in Sublime Text according to a tutorial I found here in the forums. The build system works, I can create projects and build them from within ST3. Now I need Auto Completion so I installed https://github.com/niosus/EasyClangComplete - I’ve then created a .clang_complete file with the following contents to point to the headers. Then I get errors saying ofMain.h can’t be found etc. so I guess it’s not reading the header files correctly. Can anyone help?

.clang_complete:

-stdlib=libc++,
-Isystem,
-I/usr/include/c++/4.8.2/,
-I/usr/include/c++/4.8.2/x86_64-unknown-linux-gnu/,
-I/usr/include/c++/4.8.2/ext/,
-I/usr/include/gstreamer-1.0/,
-I/usr/include/glib-2.0/,
-I/usr/lib/glib-2.0/include/,
-I/usr/include/cairo/,
-I/home/thinkpad2000/Code/openFrameworks/addons/**,
-I/home/thinkpad2000/Code/openFrameworks/libs/**,
-I./src/**

#2

Hey, I am the guy behind EasyClangComplete. :slight_smile: I see two issues with your setup.

  1. .clang_complete does not support *. It includes all the files in the folder, though.
  2. -Isystem looks strange. What exactly do you mean by this entry?

Also, if you find an issue with the plugin, feel free to open an issue on GitHub.


#3

Hi @niosus thanks for your support. How would you recommend to set up EasyClangComplete for OF generally? The -Isystem I just took from another tutorial, it might not be needed at all.


#4

I don’t know much about OF, but can give some general tips. First of all, consider to use CMake for your project (if possible). This way, you will need no manual setup at all. In case this is not an option, here is what you can do:

  • I am pretty sure that the Isystem line is not needed.
  • remove the stars from the paths, so -I/home/thinkpad2000/Code/openFrameworks/addons/** becomes -I/home/thinkpad2000/Code/openFrameworks/addons.
  • it seems that you also add folders with libraries - there is no need to do it. You only need the locations of headers for autocompletion. Are you sure these are the folders that contain OF headers?
  • make sure to include -I/usr/include.

Unfortunately, I have never worked with OF, so I can’t give you anything more specific.