0

I download the latest LLVM3.0 and Clang3.0 source, following the build instructions and finally get the VS solution file "LLVM.sln" and all the .vcproj files.

Then I build the libClang, but some errors ocurred when build project "LLVMSupport": error C2065: “PSRWLOCK”: Undefined identifier

the problem located at RWMutex.cpp which include "Windows/RWMutex.inc". in the file "RWMutex.inc" I notice a block of code:

// Windows has slim read-writer lock support on Vista and higher, so we
// will attempt to load the APIs.  If they exist, we will use them, and
// if not, we will fall back on critical sections.  When we drop support
// for XP, we can stop lazy-loading these APIs and just use them directly.
#if defined(__MINGW32__)
// Taken from WinNT.h
typedef struct _RTL_SRWLOCK {
    PVOID Ptr;
} RTL_SRWLOCK, *PRTL_SRWLOCK;

// Taken from WinBase.h
typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
#endif
...

what does it mean? should I define a "MINGW32" even if I'm using a Microsoft C++ compiler?

Haiyuan Li
  • 377
  • 2
  • 10
  • 1
    No, it means you should indicate that you're targeting Vista and later: `#define WINVER _WIN32_WINNT_VISTA` See [this question](http://stackoverflow.com/questions/1439752/what-is-winver) for details. – Cody Gray - on strike Feb 16 '12 at 04:15
  • they didn't test under VS2005? Look at:http://groups.google.com/group/llvm-dev/browse_thread/thread/a01869c14dc9f45a/487bb2dc40fed26f?show_docid=487bb2dc40fed26f# – Haiyuan Li Feb 16 '12 at 06:05
  • That has nothing to do with VS 2005. The target Windows version isn't necessarily Vista on newer versions, and it can be easily specified in VS 2005. – Cody Gray - on strike Feb 16 '12 at 06:50
  • And yes, LLVM isn't officially supporting VS 2005. – arrowd Feb 16 '12 at 07:40
  • Sorry the title is not good. it's about SDK version other than OS version – Haiyuan Li Feb 16 '12 at 09:17

1 Answers1

1

Unfortunately, VC2005 does not support standard C++ pretty well to compile llvm/clang. We saw many problems in past. So, it is advised to use VC2008/VC2010 instead.

Anton Korobeynikov
  • 9,074
  • 25
  • 28
  • concretely what kind of problem? runtime errors?I have build LLVM-2.9 with VS2005. I have to use VS2005 now. :-( – Haiyuan Li Feb 16 '12 at 09:15