Thread: Anyone gotten Clank to work on Windows?

  1. #1
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654

    Anyone gotten Clank to work on Windows?

    I am simply trying to compile some code with Clang, but I get problems from the standard library which I borrowed from GCC 4.8.

    I use the command line:

    clang++ "Square Packing.cpp" -I"C:\Program Files\Gecode\include" -I"C:\Program Files\MinGW\lib\gcc\x86_64-w64-mingw32\4.8.0\include\c++" -I"C:\Program Files\MinGW\lib\gcc\x86_64-w64-mingw32\4.8.0\include\c++\x86_64-w64-mingw32" -I"C:\Program Files\MinGW\x86_64-w64-mingw32\include" -v -std=c++11 -fno-ms-compatibility

    (Clang was built using Visual C++; I have been unable to build it with Mingw.)

    It spits out tons of errors from the standard headers (full log is attached).

    I don't even know if I'm doing this wrong. What friggin' library am I supposed to use, where do I get it and do I set up Clang to work with it?
    It's frustrating that actual instructions on this part seems to be missing!

    If anyone has gotten it working, I'd appreciate some pointers.
    Attached Files Attached Files
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,608
    Clang Compiler User’s Manual — Clang 3.3 documentation

    • GCC versions 4.5.0 to 4.5.3, 4.6.0 to 4.6.2, or 4.7.0 (for the C++ header search path)


    Downgrade.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Same error. I think I've tried with 4.6.2, as well.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Strange, that doesn't look like something Clang should have a problem with. I'm currently trying to install GCC 4.8 on my Mac; if I succeed, I can try this out.

    It's all really just one error, occurring multiple times and dragging a host of subsequent errors along.

    C:\Program Files\MinGW\lib\gcc\x86_64-w64-mingw32\4.8.0\include\c++\bits/alloc_traits.h:57:35: error: in-class initializer for static data member is not a constant expression
    static const bool __value = _S_chk<_Alloc, _Tp>(nullptr);

    For some reason, it doesn't recognize the constexpr call _S_chk<_Alloc, _Tp>(nullptr) as constant, which causes an error. This error is triggered ultimately