EasyClangComplete icon indicating copy to clipboard operation
EasyClangComplete copied to clipboard

Headers are normal but STL keep loading errors

Open ChromedomeV12 opened this issue 3 years ago • 1 comments

System info:

  • Sublime Text version: Sublime Text 4 Build 4126
  • Which system are you on: Windows 10
  • Clang version: 15.0.2

What happens:

Describe your issue here. I'm from a non-English speaking country, so apologies if my language is inaccurate or not detailed enough. My issue is similar to that of #554, however, as you can see from above. I'm using Win10, so sadly the solution there was not able to solve my problem. The bits/stdc++.h folder was fine. However, errors occurred after using queue, endl and '\n'. Here is a simplified version of my code. If there is something that I missed. Please inform me.

#include <bits/stdc++.h>
using namespace std;
queue <int> q;// ECC Error: Too few template arguments for class template "queue"
int main(){
    int r, c;
    cin>>r>>c;// ECC Warning: expression result unused
    cout<<r<<c<<endl;//ECC Error: reference to overloaded function could not be resolved; did you mean to call it?
    cout<<r<<c<<'\n';// ECC Warning: expression result unused
    return 0;
}
I'm using an integrated terminal (and because I am a newcomer) so a couldn't see the log. All I knew is that mingw64 complied and ran my code without any errors. My Settings:
{
   "hide_default_completions": false,  
   "common_flags" : [  
        // some example includes  
        "-IC:\\mingw64\\x86_64-w64-mingw32\\include\\c++",
        "-IC:\\mingw64\\x86_64-w64-mingw32\\include\\c++\\x86_64-w64-mingw32",
        "C:\\Program Files\\LLVM\\lib\\clang\\15.0.2",
    ],  
    "verbose": true,
    // C++ specific flags. Prepend common_flags for C++ files.  
    "cpp_flags" : [  
        "-std=c++11"  
    ],
}
I'm using an integrated terminal (and because I am a newcomer) so a couldn't see the log. All I knew is that mingw64 complied and ran my code without any errors. My .clang_complete:
-I/home/igor/.config/sublime-text-3/Packages/EasyClangComplete/src blah
-I/home/igor/.config/sublime-text-3/Packages/EasyClangComplete
-Ilocal_folder
-Wabi
-std=c++14
-IC:\mingw64\x86_64-w64-mingw32\include
-IC:\mingw64\x86_64-w64-mingw32\include\c++
-IC:\mingw64\x86_64-w64-mingw32\include\c++\bits
-IC:\mingw64\x86_64-w64-mingw32\include\c++\x86_64-w64-mingw32
-IC:\mingw64\x86_64-w64-mingw32\include\c++\backward

ChromedomeV12 avatar Oct 28 '22 12:10 ChromedomeV12

Thanks for reporting.

First of all, I have to ask: why do you include the bits/stdc++.h. In my understanding that is a very system-specific header to include. If you need a queue, you should instead #include <queue>.

Second. In your settings, you provided

"common_flags" : [  
        // some example includes  
        "-IC:\\mingw64\\x86_64-w64-mingw32\\include\\c++",
        "-IC:\\mingw64\\x86_64-w64-mingw32\\include\\c++\\x86_64-w64-mingw32",
        "C:\\Program Files\\LLVM\\lib\\clang\\15.0.2",
    ],

but the last entry should also be prefixed by -I. If you don't understand the -I flag, I suggest you to figure this out first. You could watch a video I recorded on the topic: https://youtu.be/Lxo8ftglwXE

Third, please do try to make the log available. Without it there is little I can help with as I have to see if the plugin is doing something wrong here.

Hope some of this helps.

niosus avatar Nov 16 '22 08:11 niosus