Sublime Forum

C/C++ header-based completition? [SOLVED]

#1

Hello everyone!
Ever since I evaluated this software in OS X, I’ve been loving it.
I was wondering if is there any plugin wich will scan the included files for functions/classes/namespaces and help with some kind of auto-completition?
More specifically speaking, I’m developing an application with GTKMM-3.0, and I would at least like it to remember myself the functions I defined in my classes.
Maybe this has allready been done, if so, can somebody point me? I tryied browsing the forums to no avail.
Thanks in advice.

0 Likes

#2

Try SublimeClang

0 Likes

#3

Hey! Thanks for the prompt reply.
I’ve installed Clang, the Package Manager plugin, and finally SublimeClang.
However, I’m wondering, can’t I use any python I’ve allready have installed instead of using pythonbrew? Wich, by the way, I’ve tried to install but still couldn’t get it to build for some awkward motive like not finding the work (!!) directory.
I’m running Gentoo Linux OS alongside Mac OS X, both have the same problem with pythonbrew…

0 Likes

#4

You don’t need to do anything special on OS X, it works out of the box.

For Linux you can use whatever python you like that gets you ctypes working within Sublime’s bundled python which happens to be 2.6.

0 Likes

#5

It didn’t however, work out of the box with OS X (Snow Leopard 10.6.3) (Maybe I’m a corner case?)
What I’m stalled now is that I copied libclang.so to $HOME/.config/sublime-text-2/Packages/SublimeClang/ and still it says that it can’t load the extention…
Python (2.6.8;2.7.3-rc2;3.1.7) was built with multilib support so I should be able to use the 64 bits version of libclang with it and sublime text 2 x64, still it’ll fail to find it…
Thanks again for the prompt response.
Regads.-

0 Likes

#6

Bump.
Ideas?
I’ve run out allready.
Tried copying around the .so for clang to no result…

0 Likes

#7

Ok, solved…
What I did was, in order:
Delete the package from package control.
Delete the Backup folder it creates (Just in case).
emerge (gentoo user here) the latest version of Clang and llvm (3.1-r4, the hardmasked one also works).
Copy both libclang and libLLVM-3.1 to the plugins main directory.
Use cmake to generate the configuration for libcache, and then make, wich built and linked the shared object for libcache.
Success. No more popup warnings whatsoever.
I beleave there should be an update on the github main comment as to reflex people to USE 3.1 instead of 3.0, since it has backwards compatibility.
Also, make a mention that under the CMakeFilelist fetched by package control, there is no mention for fetching, downloading or building libclang.
So building it is overdue to the user appart from building libcache.
Thanks in advice and hope this serves well for someone else.

0 Likes

#8

I’ve done all the steps outlined on the github page. My problem is that it only corrects the issue for a short period of time. Every so often, I’ll launch ST2 and it will be like libcache was never compiled.

0 Likes

#9

You just have to link the files I’ve stated, the problem with the backups the package control center makes is that it also takes away your includes and stuff, so you’ve got to get those back too (f.ex: gtkmm.h)

0 Likes