X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <46F33CC5.DE2BCA23@dessent.net> Date: Thu, 20 Sep 2007 20:38:45 -0700 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: one more thing References: <12807222 DOT post AT talk DOT nabble DOT com> <46F30B1B DOT 4020007 AT sbcglobal DOT net> <12809503 DOT post AT talk DOT nabble DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com 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 patrickinminneapolis wrote: > example_wrap.c includes , but gcc can't find it, can you tell me > how to tell gcc to look in c:\Program Files\Microsoft Visual Studio > 8\VC\include\ for it? Setting aside for a moment the fact that you're trying to do something totally wrong and broken, the reason the compiler cannot find is that you named the file with a .c extension and are compiling it with gcc. If you want to use C++, you need to compile with g++. If you name your files with C++ extensions (.cc, .cpp, .C) then gcc will be able to detect that you want C++ mode and that will also work, however you will likely get linking errors if you try to link with gcc when you should be using g++. In other words: always use g++ when compiling or linking C++ code. With that out of the way, you're trying to do something nutso by telling gcc to use MSVC's C++ headers. There's no way that's going to work. Implementations of C++ standard libraries and headers are very tightly bound to internal details of the compiler, so you have to use gcc's if you want to use C++ -- and you shouldn't ever need any special flags to get the compiler's own C++ headers, providing that you invoke the right driver. And even if C++ headers were not tied to the compiler implementation, g++ and MSVC++ implement different ABIs so trying to link C++ objects/libraries across vendors will fail. The only exchange of headers that typically works is when you are dealing with pure C only, and when the headers are designed to be generic and portable. Otherwise, don't expect to be able to point gcc at MSVC internal headers and have anything but great failure. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/