Udit Bhutani
Udit Bhutani

Reputation: 87

Unable to compile header bits/stdc++11 with g++

Compiling the program below on windows with g++ file.cpp -std=c++11

#include<bits/stdc++.h>
using namespace std;

int main() {
    int x = 0;
    cout << x;
    return 0;
}

gives an error that you can see on link below (unable to post error here due to stackoverflow's too much code in comparison to text constraint, sorry for posting it this way!)

https://drive.google.com/file/d/0B4w9GgJk2CmjdGg0TjluWElNRTQ/view

In file included from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\bits\postypes.h:40:0,
                 from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\iosfwd:40,
                 from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\ios:38,
                 from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\istream:38,
                 from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\sstream:38,
                 from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\complex:45,
                 from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\ccomplex:38,
                 from c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\mingw32\bits\stdc++.h:52,
                 from template.cpp:1:
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:177:11: error: '::wcscat' has not been declared
   using ::wcscat;
           ^
c:\mingw\lib\gcc\mingw32\5.3.0\include\c++\cwchar:178:11: error: '::wcscmp' has not been declared
   using ::wcscmp;
...

Any pointers where this is going wrong? (Using gcc 5.3)

Upvotes: 1

Views: 1327

Answers (1)

tso
tso

Reputation: 4924

use std=gnu++11

g++ file.cpp -std=gnu++11

Upvotes: 2

Related Questions