Problem installing Clang

Thought I would give clang a try out so installed version 3.4 pre-built binary "Clang for Windows (.sig)" from http://llvm.org/releases/download.html#3.4.
Installation seemed to go OK.

When I tried to run clang.exe I received a windows error message stating that the .exe was not a valid win32 executable. So I tried some of the other executables in the bin directory, all of them gave the same result.

My PC is running Win XP professional 5.1 with service pack 3.

So I ran the uninstall.exe which worked!

Am I miss-understanding something, installed clang incorrcetly?

Also I could not find any docs on how to use clang. The on line http://clang.llvm.org/docs/UsersManual.html is a little sparse. Curiously while I did find most of the usual include files I could not find stdio.h .

Help appreciated,
John

Hi John,

Thought I would give clang a try out so installed version 3.4 pre-built
binary "Clang for Windows (.sig)" from
http://llvm.org/releases/download.html#3.4.
Installation seemed to go OK.

When I tried to run clang.exe I received a windows error message stating
that the .exe was not a valid win32 executable. So I tried some of the other
executables in the bin directory, all of them gave the same result.

My PC is running Win XP professional 5.1 with service pack 3.

The 3.4 release for Windows doesn't support Windows XP. Unfortunately
we didn't realize this until after the release.

The good news is that the more recent versions of the snapshots at
http://www.llvm.org/builds/ are built with XP support.

Also I could not find any docs on how to use clang. The on line
http://clang.llvm.org/docs/UsersManual.html is a little sparse. Curiously
while I did find most of the usual include files I could not find stdio.h .

stdio.h isn't included because we don't provide a C standard library.
You'll have to use the standard library from Visual Studio or MinGW.

Hope this helps,
Hans

Hans,
Thanks for the reply. I'll give it a go.

Are there any examples of using clang? I mean are there any environment variables that need setting, how does the compiler know which language to compile for, link to required libraries etc.

Many thanks,
John

Hi John,

Are there any examples of using clang? I mean are there any environment
variables that need setting, how does the compiler know which language to
compile for, link to required libraries etc.

I don't know of any good examples unfortunately :confused: Our user manual is
not great in this respect.

There are basically two ways of using clang on Windows. You can either
use it as you would use gcc in a MinGW environment. clang and clang++
are designed to take the same command-line arguments as gcc and g++.

The other, newer and more experimental way, is to use clang in a
Visual Studio environment. They easiest way to do this is to run Clang
inside an environment set up by Visual Studio's envsetup.bat and then
use clang-cl.exe instead of cl.exe. clang-cl will look for headers and
libraries the same way that cl.exe does, and accept (mostly) the same
command-line arguments.

clang-cl can also be used from inside the Visual Studio IDE by
selecting LLVM as the Platform Toolset in the project properties.

Hope this helps,
Hans