BenevolentDeity
BenevolentDeity

Reputation: 645

clang++: Errors in standard header files

I just installed the 64-bit versions of Clang 3.8.1 and MinGW-w64 5.1.0 on my 64-bit Windows 10 system and after what appeared to be a completely successful installation and path configuration I attempted to compile the following code with the command line shown:

clang++ -c test.cpp

#include <iostream>
int main()
{
    std::cout << "Hello world!\n";
    return 0;
}

I first tried it with my INCLUDE paths set to the Microsoft VS2015 headers then with them set to the mingw64 headers, but there were content errors in both cases (although there were no problems with any of the header files actually being found).

In the mingw64 case the following was a typical error:

C:\mingw64\x86_64-w64-mingw32\include\stdio.h:179:86: error: expected ';'
after top level declarator int __cdecl __mingw_sprintf (char *
__restrict__ , const char * __restrict__ , ...) __MINGW_NOTHROW;

whereas in the VS2015 case the following was typical:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\limits:611:33:
error: use of undeclared identifier 'char16_t' template<> class numeric_limits<char16_t>

I also tried each of the -std=c++98 through -std=c++14 switches but it made no difference. The respective headers work fine with the gcc and cl compilers. Is there some other set of headers I should be using that is specifically tailored to Clang itself or am I simply doing something wrong?

Thanks, Ray

Upvotes: 2

Views: 1235

Answers (1)

BenevolentDeity
BenevolentDeity

Reputation: 645

Fixed:

I went back to LLVM clang 3.7.0 (release candidate 3) 64 bit and all of the problems went away with both the Microsoft and minGW64 header files. It seems like version 3.8.1 must have been a step backwards!

Upvotes: 1

Related Questions