Giter Club home page Giter Club logo

clang-complete's Introduction

Clang-Complete

A clang plugin for Sublime Text 3 (MAC OSX / Linux / Windows), providing:

  • Auto complete
  • Syntax diagnostic
  • Goto definition

Using libclang (llvm 3.5.0).

Install the Plugin

From git repository

Note: To determine the path to Sublime Text 3 Packages directory, start Sublime Text 3, Choose menu Preferences -> Browse Packages

$ cd <sublime-text-3 Packages directory>  # see note above
$ git clone https://github.com/lvzixun/Clang-Complete.git
$ cd Clang-Complete
$ make [linux / windows]

On Ubuntu, $ make linux, On Mac OSX, run the default $ make.

Windows prerequisites
  1. install MINGW-W64 32 (only if you want to compile yourself - binary is included) e.g. from here
  2. install LLVM 3.6.1

From package control

  1. Install package control
  2. command+shift + p -> install package
  3. Search Clang-Complete -> install

Installation using Package Control is only supported on Mac.

Configuration

Global options can be set in <sublime-text-3 Packages directory>/clang-complete/cc.sublime-settings file. Header files can be included in the include_options section.

Alternatively, header files can also be included from the Sublime Text 3 <name>.sublime-project files by adding the cc_include_options subsection to the settings section in your <name>.sublime-project file:

"settings":
{
    "cc_include_options":
    [
        "-I/headfile_path1",
        "-I/headfile_path2",
        "-I/headfile_path3"
        // ...
    ]
     // ...
}

Example settings for Windows:

    "settings":
    {
        "cc_include_options":
        [
            "-isystem", "C:\\MinGW\\i686-w64-mingw32\\include",
            "-isystem", "C:\\MinGW\\i686-w64-mingw32\\include\\c++",
            "-isystem", "C:\\MinGW\\i686-w64-mingw32\\include\\c++\\tr1",
            "-isystem", "C:\\MinGW\\i686-w64-mingw32\\include\\c++\\i686-w64-mingw32",
            "-isystem", "C:\\LLVM\\lib\\clang\\3.6.1\\include",
            "-DBOOST_USE_WINDOWS_H"
        ]
    }

if "cc_include_options" exists in your project settings, it will merge to the "include_options" defined in cc.sublime-settings.

Preview

Donate

Paypal

alipay支付宝账号: [email protected]

TODO LIST

feature status
support mac osx done
support linux done
support window done
support sublimetext 2 X

clang-complete's People

Contributors

asevich avatar cuiwc avatar gkalab avatar lvzixun avatar tillt avatar varqox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clang-complete's Issues

Including custom header files does not work (reopening issue #3)

I'm aware of my previous issue (#3) has been closed, but I would like you to know that it is still not possible, at least for me, to include custom header files in the (project_name).sublime-project file. However, I can include my project files in the cc.sublime-settings:
"include_options":
[
"-isystem", "/Users/.../include2,
"-isystem", "/Users/.../include1",
]

Thank you for your contribution in this plugin! I am looking forward for this fix.

Windows instal

Hello,

I can't instal this plugin. I downloaded mingwin, Instaled newer CLANG 3.7 version and added both to my environment path. When I try to make file, I get this:
mingw32-make
process_begin: CreateProcess(NULL, uname -s, ...) failed.
mingw32-make: makefile:1: pipe: No error
gcc -shared -o lib/libcc.dll -g -Wall src/cc_result.c src/cc_resultcache.c src/
cc_symbol.c src/cc_trie.c src/py_bind.c -L"C:/Users/aukstkalnis.de/AppData/Roami
ng/Sublime Text 3/Packages/Clang-Complete/lib" -I"C:/Users/aukstkalnis.de/AppDa
ta/Roaming/Sublime Text 3/Packages/Clang-Complete/lib"/include -lcang
D:/mingwin/bin/../lib/gcc/i686-w64-mingw32/4.8.4/../../../../i686-w64-mingw32/bi
n/ld.exe: cannot find -lcang
collect2.exe: error: ld returned 1 exit status
makefile:49: recipe for target 'cc_lib' failed
mingw32-make: *** [cc_lib] Error 1

I tried to change mikefile line "-lcang" to "-libclang" but that did not helped. I searched libclang.dll and libclang.lib in clang directory and placed them in /Clang-Complete/lib dir. That did not helped. I cant find libcc.dll. where it could be? I searched this dll file in windows, mingwin, cygwin,LLVM but not found... Can anyone help me to fix this issue?

Paths relative to the project directory

Great plugin, love using it!

Is it possible so specify include directories relative to the project directory?

I've got some headers in ./lib/v8/include/, at the moment I've only been able to get it to work with using the absolute path "-I/Users/geo/Desktop/v8-gles-bindings/lib/v8/" (in the sublime project file), whereas with similar plugins for Atom or vim, I can specify as -Ilib/v8/

The primary benefit is it makes the project more portable, especially when working in a team

Cannot find the file error

Hi,

I keep getting this error:

/work/c1202-firmware/msp430-os/dispatcher.h:11:10: fatal error: 'msp430-os/array_safe.h' file not found

and it points to line of code

#include "msp430-os/array_safe.h"

I do have a file named cc.sublime-settings with listing:

{
    "include_options":
    [
        "-I/work/c1202-firmware/"
    ]
}

If I ran command subl /work/c1202-firmware/msp430-os/array_safe.h, the file opens, so it does exist. So why is clang complaining that the file does not exist?

Completion list delay

When you quickly type a variable name and then, for example, semicolon the completion list appears as if there was no semicolon:
ezgif com-video-to-gif
It can be very annoying, for instance when you try to press Enter after semicolon.

On the whole, this plugin is what I have been seeking for a long time. Keep up the good work!

clang version on Ubuntu

In the make file you make the link
sudo ln -sf /usr/lib/llvm-3.5/lib/libclang-3.5.so.1 ./lib/libclang.so
since the new release the default version of clang is 3.6.0 and the line should therefore be updated to
sudo ln -sf /usr/lib/llvm-3.6/lib/libclang-3.6.so.1 ./lib/libclang.so

The problem with this solution is that the version has to be manually updated every time. Perhaps there is a way to force the installation of a certain version as default.
Note: You can write
sudo apt-get install clang-3.5
to force it to install this version. However this does not install the clang command, but only clang-3.5.

I absolutely love this plugin, keep doing a great work!

#include <fcntl.h>

when including a library at the top of a c file or in a header, I get the following message

fatal error: 'fcntl.h' file not found

and subsequently funcitons from the library are 'implicitly declared'

error: error opening 'filename.d': Permission denied

Hi,

Thanks for your plugin, it really contributes to make sublim a nice editor.

Everytime clang compile i got this error:
"error: error opening 'filename.d': Permission denied"

I use theses rules in my makefile:

CFLAGS = -MMD -Wall -Wextra -Werror -O3 -std=c++11

#Build rule
$(BIN_DIR)/$(TARGET) : $(OBJ)
    $(CC) $(CFLAGS) $^ -o $@ $(LIBS)

#Compilation rule
$(BUILD_DIR)/%.o: $(SRC_DIR)/%$(SRC_EXT)
    @mkdir -p $(dir $@)
    $(CC) $(CFLAGS) $(INC) -o $@ -c $<

-include $(DEP)

Even when i compile without -MMD, this error happens. It's not a serious problem but it's disturbing.

Thanks !

Can correctly compile for Windows

Hello, I have Windows 10 64bit and I can not correctly compile this module. I downloaded git for windows and compiled it successfully, but at the start of the Sublime I get the following error:

File "D:\User\AppData\Roaming\Sublime Text 3\Packages\Clang-Complete\cc.py", line 11, in <module> libcc = cdll.LoadLibrary("%s/lib/libcc.dll" % current_path) File "./python3.3/ctypes/__init__.py", line 431, in LoadLibrary File "./python3.3/ctypes/__init__.py", line 353, in __init__ OSError: [WinError 193] %1 не является приложением Win32 (not an app for Win32)

After that I tried to copy my libclang.dll into lib folder and recompile, but at the compilation I get the next error:

libclang.dll: file not recognized: File format not recognized

How can I install this module on Windows? I'm using it on Linux and it is the best thing that I found among all the others, because it works the best. Thanks.

Sorry for my English.

Windows平台编译报错

ST3是64位的,编译器是gcc 4.9.2(gcc-tdm-64)
编译时报错:

ld.exe: skipping incompatible libclang.dll when searching for -lclang
ld.exe: cannot find -lclang

修改Makefile,CFLAGS加-m32,编译成功。
但是ST中加载Plugin失败:

  libcc = cdll.LoadLibrary("%s/lib/libcc.dll" % current_path)
  File "./ctypes/__init__.py", line 431, in LoadLibrary
  File "./ctypes/__init__.py", line 353, in __init__
OSError: [WinError 193] %1 不是有效的 Win32 应用程序。

是什么问题呢

How do I include custom header files?

Thanks for the awesome plugin! One question however, how do I include custom header files through my project settings (*.sublime-project)? If that works, then this program is pretty much one of the best C autocomplete plugin out there.

Thanks!

macOS上没法儿用

"include_options":
[
// "-isystem", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/6.0/include",
// "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/",
// "-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1",
// "-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/",
// "-isystem", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"-isystem", "/usr/include",
"-isystem", "/usr/include/c++/*",
"-isystem", "/usr/local/opt/llvm/include",
"-isystem", "/Library/Developer/CommandLineTools/usr/include",
"-isystem", "/Library/Developer/CommandLineTools/usr/include/c++/v1",
"-isystem", "/usr/local/opt/llvm/lib"
"-isystem", "/usr/include/c++/4.2.1"
"-isystem", "/usr/local/opt/llvm/include/c++/v1"
"-Wall"
],
我的c++库都包含进去了,但还是找不到库。
image

Editing cc.sublime_settings doesn't cause build errors/warnings to update for a file until the contents of that file are changed.

This caused me a bit of confusion when I was trying to fix some missing includes. Steps:

  1. Create file with build errors due to #includeing a missing file
  2. Add the path to the #includeed file to "include_options" in cc.sublime_settings
  3. Go back to the file with build errors and save it again (e.g. with cmd+S)
  4. Build errors should be gone, but they're still there
  5. Make an edit to the file, and save again
  6. Build errors are now gone

Or if this is a limitation of Sublime Text and not something you can change, can you say what the limitation is so I can file a useful issue at https://github.com/SublimeTextIssues/Core/issues?

Error when make

I meet an error when make cc lib. I don't know about -lclang, which path should use please?

ld: library not found for -lclang
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [cc_lib] Error 1

For Cuda

Hi
Useful plugin for ST. Maybe we can work, to port to CudaText? I can help with code of Cu, eg calling listboxes..

Crash plugin host typing too quickly (objective-c)

If I'm typing a method like this:
[self doSomething:something withSomeObj:obj];
and I type the [self d too quickly (before 'self' has had a chance to be recognized) it crashed the plugin host in sublime text.

Is the a reason for sticking to clang-3.5?

If this is not a blocked then clang version can up updated to 3.8 or 4.0.

I keep seeing some weird crashes like: libclang: crash detected in code completion from time to time

Change formatting for keyword completion.

Clang-Complete appears to override Snippets for the same keywords so it would be nice if there were some way to format the completion for keywords and such.

Using the if statement completion I from Clang-Complete I get...

if(expression){statements
}

Which is pretty horrible. What I want is what the C++ Starting Kit snippets provide such as this...

if (/* condition */)
{
    /* code */
}

So is there anyway to override the Clang-Complete completion with Snippets from elsewhere or is there some way to format the output from Clang-Complete?

Edits to .sublime-project settings require sublime text restart

Repro steps:

  1. Create project that relies on non-default include paths
  2. Install plugin
  3. Edit project file, and add your non-default include path to cc_include_options. Save your changes
  4. Edit and save one of the files in your project

Expected:
The new include paths are picked up as soon as they are saved to the config, and you get no errors from Clang-Complete

Actual:
The include path is not picked up. Lots of "file not found" errors, complaining about your header files.

The work-around is to fully quit sublime text (not just close your project), and open it again. Things start working well at that point.

I think if this problem was solved that a bunch of the other issue reports would go away.

Unable to compile on Windows

Title.

No matter which version of MinGW I try to use, every time I get the "cannot find -lclang" error, and If I rename libclang.lib to libclang.a, I get "libclang.a is in an unrecognized format" error.

Could you give me a hit as to which version of mingw to use to compile it?

Or, better yet, you mentioned that there're also available binaries for windows version. Where are they?

Sublime Text built-in completion was "disabled" since Clang-Complete installed.

Thanks for developing such a useful plugin, I am currently using Sublime Text build 3103, OSX 10.11.
After installing Clang-Complete, the Sublime built-in C++ completion failed, for example, when I type if, built-in completion ought to pop a prompt box with if condition, but now the if condition prompt box just flash by and comes the Clang-Complete prompt box.

ezgif com-resize

I noticed there's "inhibit": true, option in Clang-Complete settings, which supposed to make built-in completion works with Clang-Complete, however it didn't behave like that.

Sublime hangs on completion

short description

When making code changes in included files (added through cc_include_options) sublime text will hang next time the autocomplete popup should bring up new values from last edit. After some time the plugin-host will crash.

I'm running your great plugin on Linux (Ubuntu 14.04 x64). This happens in a large project (50+ files) with a huge count of namespaces.

a more complete description

Assuming we have a project and in an included folder (through cc_include_options) we have the file include.h with following content:

...
enum class foo : uint16_t {
   NOTHING,
   SOME,
   MORE,
   ALL
};
...

In a cpp file (e.g. test.cpp) this file is included. Now I add some elements to the defined enum (e.g. NO_INFO) and save this file. Next in test.cpp file I type:

foo bar;
bar = foo::...;

Now, when the autocomplete popup should list all possible values the popup appears and sublime hangs.

Could you please have a look?

Thanks in advance,
Jörg

Plugin host has exited unecpectedly on Fedora, clang version 3.8

This plugin works wonderfully in Fedora 22 with clang 3.5 and on Ubuntu 17.04 with clang 4.0. But on fedora 24 does not work with clang 3.8. I did ln -sf /usr/lib64/libclang.so.3.8 ./lib/libclang.so, no error message on make; but plugin host exits while loading.

Getting Error "/usr/include/limits.h:123:16: fatal error: 'limits.h' file not found"

Hi,

I am getting this error:

/usr/include/limits.h:123:16: fatal error: 'limits.h' file not found

every time I save the file. But when I execute the same file in terminal, there is no errors, so:

$ clang --analyze -I/work/c1202-firmware/ -I/work/c1202-firmware/gmock/include/ -I/work/c1202-firmware/gmock/gtest/include dispat_tasks_test.cpp

Produces no errors, but running it on ST3 Produces an error.

On Linux, the Packages/Clang-Complete/ErrorPanel.tmLanguage is not found

When cloning on Linux, the plugin folder is named as clang-complete instead of Clang-Complete

  • 1 The line #58 in the clang_error.py cannot find the file named Packages/Clang-Complete/ErrorPanel.tmLanguage
  • 2 The line #29 of the makefile ST3 = ~/.config/sublime-text-3/Packages/Clang-Complete does not work correctly.

A workaround is to rename the folder from clang-complete to Clang-Complete after cloning, which will solve both of the above issues.

/usr/include/wchar.h:39:11: fatal error: 'stdarg.h' file not found

Thanks in advance. The plugin is largely working for me and seems amazing.

I'm running arch linux. I am using clang++ to compile my code without problems, so my clang implementation doesn't seem to be the issue. I'm guessing there is some sort of search path problem or a link problem.

To install, I modified the makefile by commenting out the linux_config: lines:

linux_config:
    #sudo apt-get install clang
    #sudo ln -sf /usr/lib/llvm-3.5/lib/libclang-3.5.so.1 ./lib/libclang.so

and changed the ST3 variable accordingly:

# linux
ifeq ($(UNAME_S), Linux)
    CC = gcc
    CFLAGS = -g -Wall -fPIC
    ST3 = ~/.config/sublime-text-3/Packages/Clang-Complete
    LIBCC = lib/libcc.so
endif

I ran make (not make linux) by accident, and then ran make linux, but everything seemed otherwise fine.

Whenever I save a document however, what I assume is the static analyser output appears on the bottom of the sublime window:

/usr/include/wchar.h:39:11: fatal error: 'stdarg.h' file not found

Searching the error bring up nothing recent. The most relevant thing I can find is a bug report from 2013 and the problem was a faulty symbolic link in Ubuntu... so, nothing relevant really. And I don't know enough about anything to begin troubleshooting.

Help would be MUCH appreciated.

Does not work with STL

I just downloaded it and try to get autocompletion when using the stl classes like vector and list and it does not find those files

Can't build on Windows

cc1.exe - System Error
The program can't start because libgmp-10.dll is missing from your computer.

Also, according to makefile, it tries to use this .dll:

LIBCC = lib/libcc.dll

But there's no such file in lib folder.

c++语法检测不对,use of undeclared identifier 'cout'

你好,

谢谢你开发这个插件。我在使用这个插件时发现好像语法检测有些问题,我用了"using namespace std"后,使用cout,语法检测会提示“use of undeclared identifier 'cout'。

源文件开头已经包含"iostream", 环境为Mac OS X Yosemite

以下是Log输出
reloading plugin Vintageous.test_runner
reloading plugin Vintageous.xactions
reloading plugin Vintageous.xmotions
reloading plugin Vintageous.xsupport
reloading plugin Vintageous.xsupport_mouse
reloading plugin Clang-Complete.cc
reloading plugin Clang-Complete.clang
reloading plugin Clang-Complete.clang_error
reloading plugin Clang-Complete.enum
reloading plugin Clang-Complete.st_cc
reloading plugin LaTeXTools.delete_temp_files
reloading plugin LaTeXTools.getTeXRoot
reloading plugin LaTeXTools.jumpToPDF
reloading plugin LaTeXTools.kpsewhich
reloading plugin LaTeXTools.latex_cite_completions
reloading plugin LaTeXTools.latex_ref_cite_completions
reloading plugin LaTeXTools.latex_ref_completions
reloading plugin LaTeXTools.latexCommand
reloading plugin LaTeXTools.latexEnvCloser
reloading plugin LaTeXTools.latexEnvironment
reloading plugin LaTeXTools.makePDF
reloading plugin LaTeXTools.migrate
reloading plugin LaTeXTools.parseTeXlog
reloading plugin LaTeXTools.texMacro
reloading plugin LaTeXTools.texSections
reloading plugin LaTeXTools.toggle_auto
reloading plugin LaTeXTools.toggle_focus
reloading plugin LaTeXTools.toggle_fwdsync
reloading plugin LaTeXTools.toggle_show
reloading plugin LaTeXTools.viewPDF
reloading plugin SublimeLinter.commands
reloading plugin SublimeLinter.sublimelinter
reloading plugin SublimeREPL.init
reloading plugin SublimeREPL.completions
reloading plugin SublimeREPL.lang_integration
reloading plugin SublimeREPL.run_existing_command
reloading plugin SublimeREPL.sublimerepl
reloading plugin SublimeREPL.sublimerepl_build_system_hack
reloading plugin SublimeREPL.text_transfer
plugins loaded
SublimeLinter: debug mode: off
SublimeLinter: WARNING: import of pyflakes.api module in pyflakes failed, linter will not work with python 3 code
clang options: ['-xc++', '-I/Users/dengyuliu/Downloads/VIO/include/', '-I/usr/local/Cellar/eigen/3.2.4/include/eigen3/']

谢谢!

fatal error: 'stdarg.h' file not found

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1/cstdarg:51:10: fatal error: 'stdarg.h' file not found

经过分别禁用其他插件和本插件,我这里还是提示这个错误。

会不会是我的brew install --with-clang --with-all-targets --with-rt==> Patchingal --jit llvm这个命令导致的呢?这个brew命令执行到make的时候,很长时间没有反应,我就ctrl c了。。

平台:Xcode 6.3.1,安装了command line tools,OS X 10.10.3。

Includes in cc_include_options

I have to include manually /usr/include/linux to have stddef.h I dont have to do this if I manually compile things (is this a bug) ?

After including the .../linux thing I get this message:

/usr/include/alloca.h:32:22: error: unknown type name 'size_t'

What can I do ?

Otherwise really really cool thing :)

Project settings are no longer read correctly

The project specific cc_include_options settings are no longer read correctly, a project that used to be configured properly does not work anymore since a few days.

It seems that since 092145e the project data is accessed directly and the include options are taken from the root project_data, although they should be taken from project_data["settings"]. A quick edit fixed this problem:

    if project_data and "settings" in project_data and "cc_include_options" in project_data["settings"]:
      include_opts = include_opts + project_data["settings"]["cc_include_options"]

Could it be, that the readme is outdated(the include options should now be in the root project data and the project specific options now add to the root settings instead of overwriting them)?
Also is there any reason to stop using view.settings()?

Please include MinGW support libraries within the plugin

First: Thanks for a wonderful and very helpful plugin.

When using the Windows version on my PC some libraries in the lib folder of CLang-Complete were missing so I had to add them manually:

  • libgcc_s_dw2-1.dll
  • libstdc++6.dll
  • libwinpthread-1.dll

I think these are the DLLs your library was linked to when compiling with MinGW.

Greetings,
Jörg

Autocompletion for including headers not working

I have gotten the autocompletion to work but am finding that when I go to include a header there is no autocompletion for potential headers.

Is there meant to be? If so, what am I doing wrong?

If not, please close the issue :)

Starting issue.

Hi!
I have ST3 running on my Mac OS X 10.10. Tried to use your clang-sublime plugin. However, I got the following message when loading ST3 with it:

reloading plugin Clang-Complete.cc
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 74, in reload_plugin
m = importlib.import_module(modulename)
File "./importlib/init.py", line 90, in import_module
File "", line 1584, in _gcd_import
File "", line 1565, in _find_and_load
File "", line 1532, in _find_and_load_unlocked
File "", line 584, in _check_name_wrapper
File "", line 1022, in load_module
File "", line 1003, in load_module
File "", line 560, in module_for_loader_wrapper
File "", line 868, in _load_module
File "", line 313, in _call_with_frames_removed
File "/Users/aign/Library/Application Support/Sublime Text 3/Packages/Clang-Complete/cc.py", line 8, in
libcc = cdll.LoadLibrary('%s/lib/libcc.so' % current_path)
File "./ctypes/init.py", line 431, in LoadLibrary
File "./ctypes/init.py", line 353, in init
OSError: dlopen(/Users/aign/Library/Application Support/Sublime Text 3/Packages/Clang-Complete/lib/libcc.so, 6): Library not loaded: @rpath/libclang.dylib
Referenced from: /Users/aign/Library/Application Support/Sublime Text 3/Packages/Clang-Complete/lib/libcc.so
Reason: image not found
reloading plugin Clang-Complete.clang
reloading plugin Clang-Complete.clang_error
reloading plugin Clang-Complete.enum
reloading plugin Clang-Complete.st_cc
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 74, in reload_plugin
m = importlib.import_module(modulename)
File "./importlib/init.py", line 90, in import_module
File "", line 1584, in _gcd_import
File "", line 1565, in _find_and_load
File "", line 1532, in _find_and_load_unlocked
File "", line 584, in _check_name_wrapper
File "", line 1022, in load_module
File "", line 1003, in load_module
File "", line 560, in module_for_loader_wrapper
File "", line 868, in _load_module
File "", line 313, in _call_with_frames_removed
File "/Users/aign/Library/Application Support/Sublime Text 3/Packages/Clang-Complete/st_cc.py", line 7, in
from .cc import *
File "/Users/aign/Library/Application Support/Sublime Text 3/Packages/Clang-Complete/cc.py", line 8, in
libcc = cdll.LoadLibrary('%s/lib/libcc.so' % current_path)
File "./ctypes/init.py", line 431, in LoadLibrary
File "./ctypes/init.py", line 353, in init
OSError: dlopen(/Users/aign/Library/Application Support/Sublime Text 3/Packages/Clang-Complete/lib/libcc.so, 6): Library not loaded: @rpath/libclang.dylib
Referenced from: /Users/aign/Library/Application Support/Sublime Text 3/Packages/Clang-Complete/lib/libcc.so
Reason: image not found

Is there a chance to make it work? And what is the reason for this failure? Thank you.

Chaging snippets

When I type in the C++ keyword and tab, example ifI get the following output

if(condition){statements
}

Any way to change that to a different format?

cc.sublime-settings

  • It would be great to have a cc.sublime-settings paths append to the project file paths. That way the compiler configurations would remain in cc.sublime-settings and the project specific paths can be in project file.
  • Also, if the cc.sublime-settings can be outside of the Clang-Complete repo folder, it would make it easier to upgrade.

cc_include_options

Hi,

`error: invalid argument '-std=gnu++1y' not allowed with 'C/ObjC'`
`error: invalid argument '-std=c++14' not allowed with 'C/ObjC'`
`error: invalid argument '-std=c++11' not allowed with 'C/ObjC'`

cc.sublime-settings

"additional_language_options":
{
    "c++" : ["-std=gnu++1y"],
    "c": ["-std=c89"],
    "objc": [],
    "objc++": []
}

Windows 7 x86. Plugin doesn't work. ...OSError: [WinError 126] The specified module could not be found...

Sublime Text 3083. Windows 7 x86. Clang 3.7.0
Plugin doesn't work. The Sublime Text console log below:

reloading plugin Clang-Complete-master.cc
Traceback (most recent call last):
  File "C:\Program Files (x86)\sublimetext-3083\sublime_plugin.py", line 74, in reload_plugin
    m = importlib.import_module(modulename)
  File "./importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "C:\Program Files (x86)\sublimetext-3083\Data\Packages\Clang-Complete-master\cc.py", line 11, in <module>
    libcc = cdll.LoadLibrary("%s/lib/libcc.dll" % current_path)
  File "./ctypes/__init__.py", line 431, in LoadLibrary
  File "./ctypes/__init__.py", line 353, in __init__
OSError: [WinError 126] Не найден указанный модуль
reloading plugin Clang-Complete-master.clang
reloading plugin Clang-Complete-master.clang_error
reloading plugin Clang-Complete-master.enum
reloading plugin Clang-Complete-master.st_cc
Traceback (most recent call last):
  File "C:\Program Files (x86)\sublimetext-3083\sublime_plugin.py", line 74, in reload_plugin
    m = importlib.import_module(modulename)
  File "./importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "C:\Program Files (x86)\sublimetext-3083\Data\Packages\Clang-Complete-master\st_cc.py", line 7, in <module>
    from .cc import *
  File "C:\Program Files (x86)\sublimetext-3083\Data\Packages\Clang-Complete-master\cc.py", line 11, in <module>
    libcc = cdll.LoadLibrary("%s/lib/libcc.dll" % current_path)
  File "./ctypes/__init__.py", line 431, in LoadLibrary
  File "./ctypes/__init__.py", line 353, in __init__
OSError: [WinError 126] The specified module could not be found

How can I solve this problem?

Clang modules not working.

Even with -fmodules in additional_language_options, I am unable to get past...

fatal error: could not build module 'Darwin'

mac os x 10.11.3配置的问题

我的配置文件:
{
// Additional language specific options for clang.
"additional_language_options":
{
// For example, you can use "c++": ["-std=c++11"] to enable C++11 features.
"c++" : [],
"c": ["-std=c99"],
"objc": [],
"objc++": []
},

// open or close inhibit the sublime text 3 built in word completions
"inhibit": true,

// add include options to clang
// this can also be specified as project specific options.
// add something like the following to the `settings` section in your `<name>.sublime-project` file:
// 
// 
//     
// "settings":
// {
//     "cc_include_options":
//     [
//         "-I/headfile_path1",
//         "-I/headfile_path2",
//         "-I/headfile_path3",
//         ...
//     ]
//     ...
// }
// if "cc_include_options" exists in your project settings, it'll override rather than add
// to the "include_options" defined in cc.sublime-settings.

"include_options":
[
"-isystem", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.2/include",
"-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/",
"-isystem", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1",
"-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/",
"-isystem", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
// "-isystem", "/usr/include",
// "-isystem", "/usr/include/c++/*",
"-isystem", "/Users/apple/Documents/apple/project/k-vim/bundle/YouCompleteMe/third_party/ycmd/cpp/llvm/include",
"-Wall"
],

// do not show markers for warnings or errors on save.
"hide_error_mark": false,

// do not show the panel for warnings and errors on save.
"hide_error_panel": false,

}
我输入的时候出不来,只有按.的时候才会出现提示。另外我用的是最新的3.7

autocomplete "sizeof" keyword incorrect

When using the autocomplete feature, the "sizeof" keyword/function completes as "size_tsizeof(expression-or-type)". I believe the size_t part is supposed to be the return type, not something appended to the sizeof() function. I'm using Mac OS X 10.9 (Mavericks) with Sublime Text 3 (Build 3083).

A screenshot:
image

Installing

Hi,

Why installation though package control supported only on OSX?
And how can it be installed on Windows?

Thanks

solution to `cannot find -lclang`

my environment is: Ubuntu 14.04.3 LTS - 64bit

while make linux, error occur:
/usr/bin/ld: cannot find -lclang

look at the makefile:

sudo apt-get install clang
...
cc_lib: $(FILES) *** -lclang

I do this:

cd /usr/lib/x86_64-linux-gnu
sudo ln -s libclang.so.1 libclang.so

then re- make linux
and it works.

hope this can help you.

include custom header files not work

I follow the issue #5 :

my own project header files are in /home/z/workspace/all/include and /home/z/workspace/helloworld/include,
and the .c source code files are in /home/z/workspace/helloworld/src

I create a test.sublime-project file in the same folder of cc.sublime-settings(under /home/z/.config/sublime-text-3/Packages/Clang-Complete), and write:

// test.sublime-project file
{
    "folders":
    [
        {
            "path": "."
        }
    ],

    "settings":
    {
        "cc_include_options":
        [
            // "-I/Users/zixunlv/codes/A2/src/"
            "-I/home/z/workspace/all/include",
            "-I/usr/include",
            "-I/usr/local/include",
            "-I/usr/include/x86_64-linux-gnu",
            "-I/usr/lib/gcc/x86_64-linux-gnu/4.8/include",
            "-I/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed",
            "-Wall"
        ]
    }
}

however, it does not work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.