Until someone contributes a 64-bit libclang.dll, youāll have to make do with using the 32 bit Sublime Text 2 if you want to use this plugin.
Clang (C/C++/Objective-C/Objective-C++) autocomplete
Yeah I thought this was the case. I did manage to build libclang in 64 mode for windows. However, now I get these when itās trying to autocomplete on -> or ::
Perhaps thereās an issue with how I built itā¦
Traceback (most recent call last):
File ".\sublime_plugin.py", line 175, in on_query_completions
File ".\sublimeclang.py", line 596, in on_query_completions
File ".\clang\cindex.py", line 1568, in codeComplete
WindowsError: exception: access violation writing 0x00000000000C0000
Traceback (most recent call last):
File ".\sublimeclang.py", line 175, in worker
File ".\clang\cindex.py", line 1546, in reparse
WindowsError: exception: access violation writing 0x0000000004EC0000
Hereās my libclang (x64, compiled using vc2010).
ttvd.org/temp/libclang_x64_vc2010.rar
Thanks!
Are you working with huge files or is there any other reason you must use the 64-bit executable of Sublime Text 2?
Hi,
I got it working on Arch Linux.
You have to add the header search path /usr/lib/clang/3.0/include to SublimeClangās config. If your distribution doesnāt have clang 3.0 yet, you can find those headers in clang-3.0.src/lib/Headers of llvm.org/releases/3.0/clang-3.0.tar.gz
Thanks for your work, quarnster!
Wowā¦ this is utterly mind blowing even in its early state. My vote for best pluginā¦ever?
I would have killed for the equivalent of visual studioās f12, and now i have it, plus really good code completion that just works (still a bit rough, but its great still)ā¦ props to you quarnster.
Edit: To help other newbies, to get the most out of it I had to change my options and add them to the User version of SublimeClang.sublime-settings like so: (on mac os lion, will try win 7 64 bit eventually)
"options":
"-Wall",
"-std=c++11",
"-I/usr/lib/clang/3.0/include/",
"-I/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1",
"-I/Users/alanandersen/dev"
]
Also, it seems once you install Xcode 4.2, all the gcc stuff is moved from /usr/ into /Developer, took a bit to figure that outā¦
Cheers for the props guys
Please let me know if you have any specific requests or suggestions for making it better. Pull requests with new features are welcome.
Hi, sorry for the newbyness but, on windows, how do you specify the include path ? It seems to never find my standard c includes.
[quote]Z:\local\pegasusmanager\LIBPEGASUSMANAGER_01_00_00\bins\fpgaconfig\fpgaconfig.c:15,10 - Fatal - āstdint.hā file not found
Did you configure the include path used by clang properly?
See github.com/quarnster/SublimeClang for more details on how to configure SublimeClang.
[/quote]
Thanks a lot
You need to open up the SublimeClang settings and tweak the āoptionsā list by adding ā-IC:/wherever/your/include/files/areā. A good start would be to search for stdint.h. Please let me know what path it resides in on your Windows installation and Iāll add it as a default path.
No i do not work with large files, but I found that x64 version of sublime is faster on my machine than x32 for w/e reason. Do you have any suggestion as to what might be the problem with my x64 libclang ?
Thanks.
No idea what the problem might be, but you could try this simple C++ sample and see if that works to isolate whether itās your libclang.dll or something with the python bindings thatās broken. Please do let me know if you figure it out.
Well the file is there : c:\MinGW\include
And none of those work:
"options":
"-Wall",
"-I/C/MinGW/include",
"-IC/MinGW/include",
"-IC:/MinGW/include"
]
Actually, looks like youāve found a bug in Sublime Text.
Please upgrade the plugin to the latest version just submitted that has a fix for this or move the options to your SublimeClang user settings. ā-IC:/MinGW/includeā should work just fine and is now added to the default include paths. Please let me know if this fixes the issue or if youāre still having problems. Thanks.
BTW, you probably want to edit the SublimeClang user settings anyway as the default settings might be overwritten when the plugin is updated.
This is awesome. Love this. Iāve gotten a fairly complex C++ project, and most things are now working for me.
One thing that doesnāt seem to work for me, is the ctrl-d ctrl-i to jump to the definition. It displays āDonāt know where the implementation is!ā on the sublime status line. Iāve peeked at the Python code for the error, but not sure where the problem is or how to debug the python.
Iāve tried with a simple test: myutil.h and myutil.c that exist in the same directory. Iāve also made sure that Iāve got a -I to the same directory that holds myutil.h in the SublimeClang.sublime-settings file. Iām on Mac OS X Lion.
.c file is like:
#include <myutil.h>
int myFunc(int a, int b, double c) {
return a + b;
}
and .h file just has:
int myFunc(int a, int b, double c);
Any ideas?
Thanks again for the excellent work!
Try updating the plugin now, it should be fixed in the latest version in git.
Thanks for reporting this and please let me know if it now works or if itās still broken
Is there a way to configure this to autocomplete OS X and iOS frameworks and autocomplete Objective-C properly?
Unfortunately I canāt get the frameworks to autocomplete just by adding an include path since Frameworkās are structured Name.framework/Headers/.h
But they are included as <Name/file.h>.
Is there a way to get per-project settings for plugins like this?
I ask because I work on a lot of embedded projects, where the system headers are not useful, and what you frequently want is project-relative headers plus headers from . Many (most) RTOSā have headers whose names collide with the names of system headers, so you canāt just bulk out the include path.
joh, Try adding something like this to your clang options:
"-isysroot",
"/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk",
"-D__IPHONE_OS_VERSION_MIN_REQUIRED=40300",
I donāt code in Objective-C/Objective-C++ myself, so while I believe basic support is there Iām sure it could be improved. Pull requests with more fleshed out support would be more than welcome
MikeSmith, No idea regarding per-project settings, please do let me know if you figure it out.