Home Download Buy Blog Forum Support

clang (C/C++/Objective-C/Objective-C++) autocomplete

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby RyanJ on Thu Jul 05, 2012 6:21 pm

FYI, it looks like one of your recent changes seems to have fixed the issue I was seeing. If I do see it again I'll build the libs to debug it more (I'd been too busy to attempt that yet).

so... thanks! :D
RyanJ
 
Posts: 20
Joined: Mon Sep 26, 2011 1:59 pm

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby quarnster on Thu Jul 05, 2012 6:23 pm

Cool, thanks for the update :)
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby Barabas on Wed Aug 01, 2012 3:23 pm

edit:

Never mind. It did find my include files, but it throws numerous errors on the new header files from the Windows 8 SDK, so I'll just leave it for now and try again later.
Last edited by Barabas on Sat Aug 04, 2012 12:37 pm, edited 1 time in total.
Barabas
 
Posts: 2
Joined: Wed Aug 01, 2012 3:11 pm

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby benmillerj on Thu Aug 02, 2012 6:12 pm

Hey folks,

I'm trying to get SublimeClang to play friendly with Objective-C. I've followed the suggestions on this forum and the GitHub Page and added the following to my "options":

Code: Select all
          
"/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.2.sdk",
"-D__IPHONE_OS_VERSION_MIN_REQUIRED=40300",
"-I/Users/CVSS/Documents/Reader"


However, I still get the following error when I open a file in my project:

Code: Select all
Fatal - 'UIKit/UIKit.h' file not found
Did you configure the include path used by clang properly?
See http://github.com/quarnster/SublimeClang for more details on how to configure SublimeClang.


I'm using the latest SDK, lateste build of ST2 and Running on Lion.

Any ideas? Thanks.
benmillerj
 
Posts: 1
Joined: Fri Jun 29, 2012 4:06 pm

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby Manko10 on Wed Aug 08, 2012 3:07 pm

I'm currently trying to get SublimeClang to work on my Windows notebook, but somehow I can't (be aware, I'm not really a C++ pro ;-)).
I already figured out that somehow the header include paths are hard coded and therefore don't match my GCC 4.7.0 installation under C:\MinGW\lib\gcc\mingw32\4.7.0 so I create an NTFS symlink from C:\MinGW\lib\gcc\mingw32\4.7.0 to C:\MinGW\lib\gcc\mingw32\4.6.2 which seems to work.
Alternatively I could pass the parameters -IC:/MinGW/lib/gcc/mingw32/4.7.0/include/c++ -IC:/MinGW/lib/gcc/mingw32/4.7.0/include/c++/mingw32 -IC:/MinGW/lib/gcc/mingw32/4.7.0/include/c++/backward each time when calling clang++ to get it to compiling something without telling me that it can't find the headers files (which is quite tedious, of course).

But in Sublime Text neither of these solutions work. I always get the message, that some header file (e.g. <iostream>) could not be found. And when I add this to my user config:
Code: Select all
{
    "options":
    [
        "-Wall",
        "-IC:/MinGW/lib/gcc/mingw32/4.7.0/include/c++",
        "-IC:/MinGW/lib/gcc/mingw32/4.7.0/include/c++/mingw32",
        "-IC:/MinGW/lib/gcc/mingw32/4.7.0/include/c++/backward"
    ]
}
It can find that file, but then I get the message:
C:/MinGW/lib/gcc/mingw32/4.6.2/include/c++\cwchar:46,10 - Fatal - 'wchar.h' file not found
Did you configure the include path used by clang properly?
See http://github.com/quarnster/SublimeClang for more details on how to configure SublimeClang.
What am I doing wrong?

I have MinGW installed to C:\MinGW and Clang to C:\MinGW\clang. Both their bin directories are in my $PATH variable. Compiling with clang works fine. Only SublimeClang does not.

Another issue:
I also tried installing SublimeClang on my Linux workstation, but that doesn't work either. Building Python 2.6 fails with the message:
gcc: error: directory": No such file or directory
make: *** [Modules/getbuildinfo.o] Error 1
And BTW what do I need Python 2.6 for? Why doesn't it work Python 2.7 as well, which is installed anyway?

Would be great if someone could help me out with this.
Thanks. :-)
Manko10
 
Posts: 1
Joined: Wed Aug 08, 2012 2:00 pm

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby jasedit on Mon Aug 20, 2012 4:15 pm

I'm trying to get SublimeClang to work for my dev setup. I'm currently running under Ubuntu 12.04, and have followed the instructions on the github page for installation/configuration. Whenever clang attempts to parse files, I keep getting an error like this:

Code: Select all
sublime_text: /home/jasedit/.config/sublime-text-2/Packages/SublimeClang/src/build/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp:256: clang::PreprocessingRecord::PPEntityID clang::PreprocessingRecord::addPreprocessedEntity(clang::PreprocessedEntity*): Assertion `(PreprocessedEntities.empty() || !SourceMgr.isBeforeInTranslationUnit(BeginLoc, PreprocessedEntities.back()->getSourceRange().getBegin())) && "a macro directive was encountered out-of-order"' failed.
libclang: crash detected during parsing: {
  'source_filename' : '(null)'
  'command_line_args' : ['-I/home/jasedit/.config/sublime-text-2/Packages/SublimeClang/clang/include', '-I/home/jasedit/project1/include', '-I/home/jasedit/project1/externals/include', '-x', 'c++', '/home/jasedit/project1/src/Main.cpp'],
  'unsaved_files' : [],
  'options' : 13,
}


Every time it attempts to parse a file. I'm not entirely sure what's going on here, but I'm not getting any auto-completion results. Any ideas?
jasedit
 
Posts: 1
Joined: Mon Aug 20, 2012 4:07 pm

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby OnOff on Fri Aug 24, 2012 6:32 am

I use Windows 7 x64, Sublime Text 2 dev channel, build 2216, MinGW 4.7.0
Image
Clang analysis shows errors in headers mingw, but i compile the project with mingw32-g++ without errors or warnings.
Sorry for my english.
OnOff
 
Posts: 1
Joined: Thu Aug 23, 2012 6:20 pm
Location: Russia

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby RyanJ on Fri Aug 24, 2012 2:50 pm

OnOff wrote:Clang analysis shows errors in headers mingw, but i compile the project with mingw32-g++ without errors or warnings.


My guess is missing include paths or a missing preprocessor define.
RyanJ
 
Posts: 20
Joined: Mon Sep 26, 2011 1:59 pm

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby aspcartman on Sun Sep 30, 2012 3:39 am

Am I missing smth, but where is the autocompletion? I've passed headers path to the plugin (include in 10.8 SDK folder under the xcode.app) but still nothing is being autocompleted. Is there a way to get full-featured autocompletion like xcode and VS have? It's so inconvenient to open a manpage every time I need to call a function =\. No, srsly, how can people work this way? :shock:
PS
I'm talking about plain C autocomplete. You now, strlen, sprintf, mkfifo, other stuff.
aspcartman
 
Posts: 2
Joined: Sun Sep 30, 2012 3:32 am

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby aspcartman on Sun Sep 30, 2012 4:25 am

aspcartman
 
Posts: 2
Joined: Sun Sep 30, 2012 3:32 am

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 10 guests