Problems Building clang / llvm "examples" in Windows7 / VS2010,

Hi All,

I’ve been experimenting with a recent build of clang / llvm.

I downloaded a new trunk following the directions from:

http://clang.llvm.org/get_started.html

http://wiki.llvm.org/How_do_I_compile_on_Visual_C%2B%2B%3F

Below is my configuration:

Clang / LLVM Build: 111612

OS: Windows7 – 32bit

Dev. Environment: Visual Studio 2010

CMake Version: 2.8.0

I can build fine without errors if I use the default configuration from the CMake GUI.

Nevertheless, I am getting a large number of warnings (173).

Additionally, when I use the CMake GUI, and when I check the flags for:

· Clang->Examples

· llvm->Examples

I’m getting LNK2019 error (Unresolved external symbol).

It’s essentially not building:

· PrintFunctionNames.dll

· clang-interpreter.exe

Is it possible that my CMake configuration is not setup properly or perhaps an environment variable is not setup properly?

I’ve spent a ton of time trying to track this down, but have had no luck so far….

I’ve also read all the posts on problems with Visual Studio 2010 due to Clangs lack of support for C++ 0x, but this doesn’t look like the cause here, but perhaps I’m wrong……

Any suggestions would be appreciated.

Thanks,

Yahya

Below is the Visual Studio 2010 output:

I’m getting this errors too on FreeBSD with trunk llvm+clang. With any build (configure and CMake).

I just tried again with clang / llvm Build -r111621 but had the same errors.

I tried to build without turning the “example” flag on for both clang & llvm in CMake GUI.

This builds without errors.

I ran clang-test and I had the following results:

1> Failing Tests (34):

1> Clang :: Analysis/complex.c

1> Clang :: Driver/darwin-ld.c

1> Clang :: Index/code-complete-errors.c

1> Clang :: Index/code-completion.cpp

1> Clang :: Index/complete-at-directives.m

1> Clang :: Index/complete-at-exprstmt.m

1> Clang :: Index/complete-categories.m

1> Clang :: Index/complete-enums.c

1> Clang :: Index/complete-exprs.c

1> Clang :: Index/complete-hiding.c

1> Clang :: Index/complete-interfaces.m

1> Clang :: Index/complete-macros.c

1> Clang :: Index/complete-member-access.m

1> Clang :: Index/complete-method-decls.m

1> Clang :: Index/complete-objc-message-id.m

1> Clang :: Index/complete-objc-message.m

1> Clang :: Index/complete-pch.m

1> Clang :: Index/complete-properties.m

1> Clang :: Index/complete-property-flags.m

1> Clang :: Index/complete-property-getset.m

1> Clang :: Index/complete-protocols.m

1> Clang :: Index/complete-recovery.m

1> Clang :: Index/complete-tabs.c

1> Clang :: Index/complete-type-factors.m

1> Clang :: Index/complete-unterminated.c

1> Clang :: Index/preamble-reparse.c

1> Clang :: Index/preamble.c

1> Clang :: Lexer/digraph.c

1> Clang :: Misc/predefines.c

1> Clang :: Preprocessor/objc-pp.m

1> Clang :: Sema/const-ptr-int-ptr-cast.c

1> Clang :: Sema/init.c

1> Clang :: SemaCXX/nullptr.cpp

1> Clang :: SemaCXX/reinterpret-cast.cpp

1>

1> Expected Passes : 2416

1> Expected Failures : 30

1> Unexpected Failures: 34

Some of the errors that occurred often in clang-test were below:

1>CUSTOMBUILD : error : ‘error’ diagnostics seen but not expected:

1>

1> Line 48: unknown type name ‘__w64’

1>

1> Line 48: expected identifier or ‘(’

1>

1> Line 402: unknown type name ‘__w64’

1>

1> Line 402: expected identifier or ‘(’

1>

1> Line 409: unknown type name ‘size_t’

1>

1> Line 418: unknown type name ‘__w64’

1>

1> Line 418: expected identifier or ‘(’

1>

1> Line 436: unknown type name ‘__w64’

1>

1> Line 436: expected identifier or ‘(’

1>

1> Line 473: unknown type name ‘__w64’

1>

1> Line 473: expected identifier or ‘(’

1>

1> Line 478: unknown type name ‘__int64’

1>

1> Line 553: unknown type name ‘__int64’

1>

1> Line 554: expected ‘;’ after top level declarator

1>

1> Line 60: unknown type name ‘_ULonglong’

1>

1> Line 63: unknown type name ‘_ULonglong’

1>

1> Line 66: unknown type name ‘_ULonglong’

1>

1> Line 69: unknown type name ‘_ULonglong’

1>

1> Line 12: use of undeclared identifier ‘intptr_t’

1>

1> Line 16: use of undeclared identifier ‘intptr_t’

Any suggestions anyone?

Yahya

Some tests (about 12) are failing on Windows, this is normal, I get
the same result. Just ignore them. They will be fixed when someone
decides to do something about it.

The bunch of index/* tests failing is a recent thing though.

Can someone suggest a recent "reasonably" stable build revision where the
clang "examples" build properly?
I'm referring to a Windows7 & VS2010 configuration.

So far for the 2.8 patches of Clang / LLVM I've tried, the clang "examples"
do not build correctly.

As of clang / llvm -r111717 the unresolved externals problem still exists.

Thanks,

Yahya