delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/09/22/07:35:13

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: RE: g_assertions
Date: Mon, 22 Sep 2008 12:34:17 +0100
Message-ID: <5E25AF06EFB9EA4A87C19BC98F5C87530188805C@core-email.int.ascribe.com>
In-Reply-To: <002e01c91c9b$30fb6460$4001a8c0@mycomputer>
References: <002e01c91c9b$30fb6460$4001a8c0 AT mycomputer>
From: "Phil Betts" <Phil DOT Betts AT ascribe DOT com>
To: <cygwin AT cygwin DOT com>
Reply-To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m8MBZCGO024231

John Emmas wrote on Monday, September 22, 2008 11:09 AM::

> Hi - I hope this is an appropriate place to ask this question.  I'm
> just starting to use Cygwin.  Firstly, the Cygwin web site says that
> the current version is 1.5.25-15 but my install log says that it
> installed 2.573.2.3 so I'm a bit confused about that.

2.573.2.3 is the version number of setup.exe, 1.5.25-15 is the version
number of the cygwin library.

> I'm now starting to compile a project using glibmm.  Inside glib.h
> there are some assertions, defined something like this:-
> 
> #define g_assert(expr)   G_STMT_START{  \
>      if (!(expr))      \
>        g_log (G_LOG_DOMAIN,     \
>        G_LOG_LEVEL_ERROR,    \
>        "file %s: line %d: assertion failed: (%s)", \
>        __FILE__,      \
>        __LINE__,      \
>        #expr);   }G_STMT_END
> 
> These compile perfectly with my gcc compiler but when I try to use
> them with Cygwin I get this error:-
> 
> error:  stray '\' in program
> 
> It's pretty obvious why this is happening - but terminating a line
> with '\' is valid code.

I bet the obvious reason I'm thinking of isn't the one you're thinking
of.  Your glib.h almost certainly has DOS style line endings, but the
header is on a UNIX mount.  This means that the compiler sees a '\r'
after the \, which is NOT valid code.

You don't say where your glib.h came from, but I'd wager it's not from
the cygwin package.  If you're compiling a cygwin program, you need to 
install cygwin's glib2 package, and the matching glib2-devel package.  

Had you *attached* the output of cygcheck -svr as requested here:

> Problem reports:       http://cygwin.com/problems.html

It would have been easy to confirm that you were not using the cygwin
packaged glib.


Phil
-- 
This email has been scanned by Ascribe PLC using Microsoft Antigen for Exchange.

--
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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019