[LLVMdev] How to compile a simple C program with clang on Windows 8.1?

Unga unga888 at yahoo.com
Sun Apr 26 00:50:45 PDT 2015


Hi all
I need a small help to get my first C program to compile on Widows 8.1. I'm an Unix guy but new to Windows.
I installed MS Visual Studio 2013 free version and the LLVM 3.6.0 binary pre-built version.
Here is my sample C program:
#include <stdio.h>
int main() {
  printf("hello world\n");
  return 0;
}

1.
>clang test1.c -o test1.exe
test1.c:2:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
2.>clang test1.c -I"c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include" -o test1.exe
In file included from test1.c:2:
In file included from c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdio.h:20:
In file included from c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\crtdefs.h:74:
c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\vadefs.h:50:9: error:
      unknown type name '__w64'
typedef _W64 unsigned int   uintptr_t;
My questions:
a) Am I referring to the correct C header files folder?
b) Do I have to include a Windows specific include file where __w64 is defined?
Many thanks in advance.
Best regardsUnga

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150426/a48e8f32/attachment.html>


More information about the llvm-dev mailing list