Hi,<br><br>I built Clang using the "Getting Started" & "Using Visual Studio" section.<br><br>A brief on my Platform:<br> Intel Pentium D<br> Microsoft Windows XP Service Pack 3<br><br> Installed Compilers:<br>
Microsoft Visual Studio 9.0<br> Microsoft Visual Studio 10.0<br> <br>I ran cmake like the following<br><br> cmake -G "Visual Studio 9 2008" .<br><br> <br>I am trying to compile a simple C++ Hello World code.<br>
<br> //helloworld.cpp<br> #include <iostream><br> <br> int main( /*int argc, char **argv*/ ) <br> { <br> std::cout << "hello world\n"; <br> return 0;<br> }<br> <br>
<br>When I compiled helloword.cpp, I got errors from Visual Studio 10 Include Directory.<br>Is there any way to specify to Clang where the Include directory is? I like to use the MSVC 9.0 Include Dir.<br>How does Clang to assume that the compiler is VS2010? Remember that I chose -- cmake -G "Visual Studio 9 2008" . --<br>
<br><br>Thanks,<br>Fernando.<br><br><br>------------------------------------------------------------------------------------------<br>Compile Errors:<br>------------------------------------------------------------------------------------------<br>
<br><br>> clang helloworld.cpp<br>In file included from helloworld.cpp:3:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/iostream:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/istream:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ostream:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ios:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocnum:10:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/streambuf:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xiosbase:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocale:8:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/stdexcept:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/exception:38:<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/eh.h(58) : error: unknown type name 'type_info'<br>
_CRTIMP int __cdecl _is_exception_typeof(_In_ const type_info &_Type, _In_ struct _EXCEPTION_POINTERS * _ExceptionPtr);<br> ^<br>In file included from helloworld.cpp:3:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/iostream:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/istream:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ostream:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ios:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocnum:10:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/streambuf:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xiosbase:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocale:8:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/stdexcept:7:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xstring:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xmemory:7:<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/new(51) : error: exception specification in declaration does not match previous<br>
declaration<br>_Ret_bytecap_(_Size) void *__CRTDECL operator new(size_t _Size) _THROW1(_STD bad_alloc);<br> ^<br>note: previous declaration is here<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/new(79) : error: exception specification in declaration does not match previous<br>
declaration<br>_Ret_bytecap_(_Size) void *__CRTDECL operator new[](size_t _Size)<br> ^<br>note: previous declaration is here<br>In file included from helloworld.cpp:3:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/iostream:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/istream:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ostream:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ios:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocnum:10:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/streambuf:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xiosbase:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocale:8:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/stdexcept:7:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xstring:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xmemory:8:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xutility:8:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/utility:9:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits:7:<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xtr1common(355) : error: rvalue references are only allowed in C++0x<br>
struct _Remove_reference<_Ty&&><br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xtr1common(368) : error: rvalue references are only allowed in C++0x<br>
struct _Remove_rvalue_reference<_Ty&&><br> ^<br>In file included from helloworld.cpp:3:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/iostream:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/istream:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ostream:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/ios:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocnum:10:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/streambuf:6:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xiosbase:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xlocale:8:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/stdexcept:7:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xstring:6:<br>
In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xmemory:8:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/xutility:8:<br>In file included from C:\Program Files\Microsoft Visual Studio 10.0\VC\include/utility:9:<br>
C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(243) : error: rvalue references are only allowed in C++0x<br> typedef _Ty && type;<br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(427) : error: rvalue references are only allowed in C++0x<br>
struct is_rvalue_reference<_Ty&&><br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(554) : error: '_From' does not refer to a value<br>
struct is_convertible _IS_CONVERTIBLE(_From, _To)<br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits:554:40: note: instantiated from:<br> struct is_convertible _IS_CONVERTIBLE(_From, _To)<br>
^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(553) : note: declared here<br>template<class _From, class _To><br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(555) : error: expected class name<br>
{ // determine whether _From is convertible to _To<br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(720) : error: expected expression<br> struct has_nothrow_constructor _HAS_NOTHROW_CONSTRUCTOR(_Ty)<br>
^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits:42:36: note: instantiated from:<br> : _Cat_base<is_pod<_Ty>::value || __has_nothrow_constructor(_Ty)><br>
^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(721) : error: expected class name<br> { // determine whether _Ty has a nothrow constructor<br>
^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(726) : error: expected expression<br> struct has_nothrow_copy _HAS_NOTHROW_COPY(_Ty)<br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits:44:36: note: instantiated from:<br>
: _Cat_base<is_pod<_Ty>::value || __has_nothrow_copy(_Ty)><br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(727) : error: expected class name<br>
{ // determine whether _Ty has a nothrow copy constructor<br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(733) : error: expected expression<br> struct has_nothrow_default_constructor _HAS_NOTHROW_CONSTRUCTOR(_Ty)<br>
^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits:42:36: note: instantiated from:<br> : _Cat_base<is_pod<_Ty>::value || __has_nothrow_constructor(_Ty)><br>
^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(734) : error: expected class name<br> { // determine whether _Ty has a nothrow constructor<br>
^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(739) : error: expected expression<br> struct has_nothrow_copy_constructor _HAS_NOTHROW_COPY(_Ty)<br> ^<br>
C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits:44:36: note: instantiated from:<br> : _Cat_base<is_pod<_Ty>::value || __has_nothrow_copy(_Ty)><br> ^<br>
C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(740) : error: expected class name<br> { // determine whether _Ty has a nothrow copy constructor<br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(746) : error: expected expression<br>
struct has_nothrow_assign _HAS_NOTHROW_ASSIGN(_Ty)<br> ^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits:46:36: note: instantiated from:<br> : _Cat_base<is_pod<_Ty>::value || __has_nothrow_assign(_Ty)><br>
^<br>C:\Program Files\Microsoft Visual Studio 10.0\VC\include/type_traits(747) : error: expected class name<br> { // determine whether _Ty has a nothrow assignment operator<br>
^<br>fatal error: too many errors emitted, stopping now [-ferror-limit=]<br><br><br>------------------------------------------------------------------------------------------<br><br>