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

Headers are normal but STL keep loading errors #769

Open
ChromedomeV12 opened this issue Oct 28, 2022 · 1 comment
Open

Headers are normal but STL keep loading errors #769

ChromedomeV12 opened this issue Oct 28, 2022 · 1 comment

Comments

@ChromedomeV12
Copy link

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
@niosus
Copy link
Owner

niosus commented Nov 16, 2022

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.

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