X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <50EEEA49.1050507@alice.it> Date: Thu, 10 Jan 2013 17:20:25 +0100 From: Angelo Graziosi User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Cygwin Subject: Clang and windows headers Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Trying to compile a C++ source file including windows.h header with clang++, fails with #error Must define a target architecture For example, $ cat foo.cxx #include int main() { return 0; } $ clang++ -c foo.cxx -o foo.o In file included from foo.cxx:1: In file included from /usr/include/w32api/windows.h:69: In file included from /usr/include/w32api/windef.h:139: /usr/include/w32api/winnt.h:375:2: error: Must define a target architecture. #error Must define a target architecture. ^ /usr/include/w32api/winnt.h:2410:7: error: unknown type name 'PCONTEXT'; did you mean '_CONTEXT'? PCONTEXT ContextRecord; ^ /usr/include/w32api/excpt.h:84:96: note: '_CONTEXT' declared here ..._EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); ^ In file included from foo.cxx:1: In file included from /usr/include/w32api/windows.h:69: In file included from /usr/include/w32api/windef.h:139: /usr/include/w32api/winnt.h:2410:16: error: field has incomplete type '_CONTEXT' PCONTEXT ContextRecord; ^ /usr/include/w32api/excpt.h:84:96: note: forward declaration of '_CONTEXT' ..._EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); ^ In file included from foo.cxx:1: In file included from /usr/include/w32api/windows.h:69: In file included from /usr/include/w32api/windef.h:139: /usr/include/w32api/winnt.h:5668:25: error: variable has incomplete type 'void' NTSYSAPI VOID NTAPI RtlCaptureContext(PCONTEXT ContextRecord); ^ /usr/include/w32api/winnt.h:5668:43: error: use of undeclared identifier 'PCONTEXT' NTSYSAPI VOID NTAPI RtlCaptureContext(PCONTEXT ContextRecord); ^ In file included from foo.cxx:1: In file included from /usr/include/w32api/windows.h:70: /usr/include/w32api/winbase.h:611:11: error: unknown type name 'PCONTEXT'; did you mean '_CONTEXT'? typedef PCONTEXT LPCONTEXT; ^ /usr/include/w32api/excpt.h:84:96: note: '_CONTEXT' declared here ..._EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); ^ In file included from foo.cxx:1: In file included from /usr/include/w32api/windows.h:70: /usr/include/w32api/winbase.h:1375:67: error: unknown type name 'CONTEXT'; did you mean '_CONTEXT'? ...WINAPI SetThreadContext(HANDLE hThread,CONST CONTEXT *lpContext); ^ /usr/include/w32api/excpt.h:84:96: note: '_CONTEXT' declared here ..._EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); ^ 7 errors generated. Really I have seen this the first time trying to build the next release of ROOT (i.e. source from svn; the main page for ROOT is : http://root.cern.ch). Indeed now ROOT uses clang tools to build (GCC is used to bootstrap ROOT's patched version of CLANG...). Nevertheless the same errors occurs using Cygwin's CLANG as the above simple test case shows... Ciao, Angelo. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple