Compilation Error bug
krsinghshubham opened this issue · 10 comments
I've just checked and it seems to still work with a simpler template, so something must be different... Could this be something about your template? Does int main(){}
compile? Does #include <bits/stdc++.h> int main(){}
compile? Are you using the type the error message mentions (and does removing that part of the template help)? Does some value of "Icie: Compile: Cpp Standard" help? Does your code compile on say, Godbolt with gcc 8.1.0 and -std=c++17? Could you include the code you're trying to compile?
hi, just checked it with a simpler code from geeksforgeeks.
same problem persisits.
code:
// A school method based C++ program to
// check if a number is prime
#include <bits/stdc++.h>
using namespace std;
// function check whether a number
// is prime or not
bool isPrime(int n)
{
// Corner case
if (n <= 1)
return false;
// Check from 2 to n-1
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return true;
}
// Driver Program
int main()
{
isPrime(11) ? cout << " true\n" :
cout << " false\n";
return 0;
}
update : extension is not working with #include <bits/stdc++.h>
working fine with #include
how to resolve this ??
With #include <bits/stdc++.h>
it fails with the same message for me too, so mystery solved. :) I forgot about this, but Windows doesn't like bits/stdc++.h
for some inexplicable reasons. Just #include <iostream>
, #include <vector>
and everything else you need in your template instead.
i understand, but there are many stl functions working on their separate libraries and i am a big fan of stl. So...
- is there a comprehensive list of all the headers need to be included for proper functioning in case of absence of <bits/stdc++.h>
thanks anyways for this awesome extension. ❤
HI bro , i check with windows forums windows already fixed this problem for mingW.
even the vscode official setup guide results into 0 failure because of the header.
it might me because of some old dependencies being used in the extension.
please fix.
This is a problem with MinGW, not with the extension - the extension pretty much only calls MinGW's g++.exe with a path to the source file and a path to the output. You just need to find and install a newer version of MinGW where this problem is fixed.
The list of all headers can be found at e.g. https://en.cppreference.com/w/cpp/header, though you probably won't need all of them.
but i am able to combine it manually using mingw only.
You probably did not use the -std=c++17 flag when compiling manually, since the error message mentions something from later standards. As I mentioned, you can use the "Icie: Compile: Cpp Standard" config option to change the C++ standard used.
aaah, solved. THANKS A TON MAN, GOD BLESS YOU.