Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com Date: Fri, 23 Sep 2005 23:01:08 +0200 (MET DST) From: Angelo Graziosi To: cygwin@cygwin.com Subject: Strange behaviour with g++ 3.4.4-1 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Rebuilding, with GCC 3.4.4-1, a few my Windows applications (those that use -mwindows), I have found a compiler error that was absent in the build with GCC 3.3.3-3. I have created the simplest test case that reproduces the 'phenomenon' ---------------------------------------- // // test.cpp // // Compile with: // // g++ test.cpp -o test // #include #include #include using namespace std; int main() { cout << "Hello, World" << endl; return 0; } ---------------------------------------- Trying to build, the result is: ---------------------------------------- $ g++ test.cpp -o test In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/sstream:640, from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/complex:51, from test.cpp:8: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc: In member function `virtual typename std::basic_stringbuf<_CharT, _Traits, _Alloc>::int_type std::basic_stringbuf<_CharT, _Traits, _Alloc>::overflow(typename _Traits::int_type)': /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:102: error: expected unqualified-id before '(' token /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/sstream.tcc:104: error: expected unqualified-id before '(' token In file included from test.cpp:8: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/complex: In function `_Tp std::abs(const std::complex<_Tp>&)': /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/complex:551: error: expected unqualified-id before '(' token ---------------------------------------- It seems that the '#include ' does not like to stay between that of and . Moving it at the beginning or at the end , works. i.e. with the sequences #include #include #include or #include #include #include the build is completed without errors. With GCC 3.3.3-3 the build works in any case. With more complex applications (that have many includes which include others etc.) is not simple to establish the order in which the inclusion of windows.h apperars. Best regards, Angelo. -- 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/