Thread: Anyone gotten Clank to work on Windows?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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 from vector's attempt to rebind the allocator you passed to the type you passed (to protect itself from stupid people writing vector<double, allocator<int>>). So allocator_traits<Alloc>::rebind<double>:ther fails to instantiate, and the compiler attempts to recover by making the result int and moving on. But now vector uses 'int' as its allocator type, which causes all sorts of errors when it subsequently attempts to access allocator's various nested types.

    This occurs once for every vector instantiation, and your program includes two, both somewhere in the RNGs that you presumably use (or at least include).

    Edit: Also, I have no idea if this would help this problem, but you will probably have to play with the target triple, if only to get things to link. I believe a VS-built Clang defaults to its incompletely emulated Microsoft ABI, which means all the mangling would be different from the MinGW libstdc++.
    Last edited by CornedBee; 05-05-2013 at 08:02 AM.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can't get MCAST_JOIN_GROUP to work on Windows 7
    By Clairvoyant1332 in forum Windows Programming
    Replies: 1
    Last Post: 03-18-2013, 06:33 AM
  2. Does \n work on Windows?
    By Programmer_P in forum C++ Programming
    Replies: 2
    Last Post: 06-11-2010, 12:32 PM
  3. compiled under windows, work for mac os?
    By Shadow12345 in forum C++ Programming
    Replies: 1
    Last Post: 05-09-2002, 09:55 AM
  4. Getting Layered Windows to Work
    By Si in forum Windows Programming
    Replies: 3
    Last Post: 01-22-2002, 06:21 PM
  5. Replies: 6
    Last Post: 01-07-2002, 02:46 AM