Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find STL on macOS 10.14 (clang 10.0) #554

Closed
Kartik-715 opened this issue Dec 17, 2018 · 16 comments
Closed

Cannot find STL on macOS 10.14 (clang 10.0) #554

Kartik-715 opened this issue Dec 17, 2018 · 16 comments

Comments

@Kartik-715
Copy link

Kartik-715 commented Dec 17, 2018

Create minimal example if you can

#include <bits/stdc++.h>

using namespace std;


int main( int argc , char ** argv )
{
     queue<int> q ; // Too few template arguments for class 'queue'
     vector<int> x ; // No Autocompletions!
    
   
    return 0 ; 
}

System info:

  • Sublime Text version: 3.11 Build 3176
  • Which system are you on: macOS Mojave 10.14
  • Clang version: 10.0

What happens:

Ecc is not working with stl items like queue vector and maps! Only autocompleting string

log.txt

@Kartik-715
Copy link
Author

Kartik-715 commented Dec 17, 2018

screenshot 2018-12-17 at 9 08 51 pm

Errors like these are all over the header files!

@niosus
Copy link
Owner

niosus commented Dec 18, 2018

I'm confused. Both the queue and the vector do take template parameters. If you don't provide them the completion is not possible. Or am I getting something wrong? Also, the example you show is a legitimate warning from clang as far as I understand.

@Kartik-715
Copy link
Author

Kartik-715 commented Dec 18, 2018

There is something wrong with github probably! No matter how many times i edit! It shows the same!
I'm typing correct queue< int > and vector< int >

@niosus
Copy link
Owner

niosus commented Dec 19, 2018

Ah, you need to use fenced code blocks. Please update your issue so that it is readable.

@Kartik-715
Copy link
Author

Hope that works?

@niosus
Copy link
Owner

niosus commented Dec 19, 2018

Why do you include the header you include here? Should you rather try to include #include <vector> and #include <queue>?

@Kartik-715
Copy link
Author

I’m not new to this plugin! I’ve been using it since the past 1 1/2 year! I love it! I got a new laptop and its not working on it! The header is alright! I have also tried with queue and vector instead! Doesn’t work :(

@niosus
Copy link
Owner

niosus commented Dec 19, 2018

I see. I don't see any issues in the log, so it must be a configuration issue. It means that libclang cannot find the proper includes. Can you run these commands in your terminal and copy the output here?

touch /tmp/temp.cc
clang++ -c /tmp/temp.cc -v

@niosus
Copy link
Owner

niosus commented Dec 19, 2018

Also, seems related to #528. Did you do what @eyun221 suggested here: #528 (comment) ?

@niosus niosus changed the title ECC Not Working with some stl items! Cannot find STL on macOS 10.14 (clang 10.0) Dec 19, 2018
@Kartik-715
Copy link
Author

Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
"/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.14.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name temp.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 409.12 -v -coverage-notes-file /Users/kartik7151/Programming/Algorithms/Dynamic Programming/temp.gcno -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0 -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/kartik7151/Programming/Algorithms/Dynamic Programming -ferror-limit 19 -fmessage-length 140 -stack-protector 1 -fblocks -fencode-extended-block-signature -fobjc-runtime=macosx-10.14.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o temp.o -x c++ /tmp/temp.cc
clang -cc1 version 10.0.0 (clang-1000.10.44.4) default target x86_64-apple-darwin18.2.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
/Library/Developer/CommandLineTools/usr/include/c++/v1
/usr/local/include
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include
/Library/Developer/CommandLineTools/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.

@Kartik-715
Copy link
Author

Kartik-715 commented Dec 19, 2018

Okay! So what I've found is when i include bits/stdc++.h it doesn't work with stl while it works when i include #include <queue> Not sure what can be possibly wrong with #include <bits/stdc++.h>

@Kartik-715
Copy link
Author

Got it working! There was an included header which wasn't present in the system! Uncommented that and it started working again :)
Thanks and sorry for the trouble!
I love this plugin :)

@niosus
Copy link
Owner

niosus commented Dec 19, 2018

Glad you solved it and thanks for the kind words. Can you post your working common_flags here so that I could update the docs?

@Kartik-715
Copy link
Author

Sure :)

"common_flags" : [
    // some example includes
    "-I/usr/include/",
    "-I/usr/local/include",
    "-I/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0",
    "-I/Library/Developer/CommandLineTools/usr/include/c++/v1",       

    ],

@niosus
Copy link
Owner

niosus commented Dec 21, 2018

Ok, I will reopen it until I add the docs.

@niosus niosus reopened this Dec 21, 2018
niosus added a commit that referenced this issue Dec 23, 2018
* Refactoring of the way we search for libclang
* Revert to original code in cindex modules
* Update documentation, partially fix #557
* Fix by providing example settings in docs #554
@niosus
Copy link
Owner

niosus commented Dec 23, 2018

Closed in #558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants