Alex Rivera | Logout

Clang on Windows

Asked 2012-01-16T16:08:03.250
23

First of all, I've followed "Getting Started: Building and Running Clang". In particular, I've built it according to "Using Visual Studio" section. In other words, I've built it using Visual Studio 2010.

Secondly, I've manually set include and library paths to MinGW distribution:

enter image description here

The simple program I'm trying to compile:

#include <iostream>
using namespace std;

int main() {
    cout << "Hello, World!" << endl;
    return 0;
}

I get the following feedback from the compiler:

In file included from C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\iostream:39:
In file included from C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\ostream:39:
In file included from C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\ios:38:
In file included from C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\iosfwd:41:
In file included from C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\bits/postypes.h:41:
C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\cwchar:144:11: error: no member named 'fgetws' in the global namespace
  using ::fgetws;
        ~~^
C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\cwchar:146:11: error: no member named 'fputws' in the global namespace
  using ::fputws;
        ~~^
C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\cwchar:150:11: error: no member named 'getwc' in the global namespace
  using ::getwc;
        ~~^
C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\cwchar:151:11: error: no member named 'getwchar' in the global namespace
  using ::getwchar;
        ~~^
C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\cwchar:156:11: error: no member named 'putwc' in the global namespace
  using ::putwc;
        ~~^
C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\cwchar:157:11: error: no member named 'putwchar' in the global namespace
  using ::putwchar;
        ~~^
6 errors generated.
Edit
Report

1 Answer

1

The obvious answer is you forgot sending -fno-ms-compatibility to clang++ :P

  1. You are right.
  2. VC++ is GUI tool-chain, MinGW is character console.
  3. No as clang is mature enough for public consumption but still to stabilize so let its dev team work on the code otherwise you risk work that might become lost island. I'm using -I as your example suggests.

I'm doing windows app dev using VS and use clang+CodeBlocks for sharing aspects neutral to platform's domain.

answered 2013-03-04T12:14:46.210

Your Answer