g_assertions

John Emmas johne53@tiscali.co.uk
Mon Sep 22 13:33:00 GMT 2008


Thanks Phil,

That sounds very plausible but I'm not sure it's right in this case.  I only
have 2 copies of glib.h on my system and I'm pretty sure they came with the
Cygwin installation.  I looked at both of them in a hex editor and they seem
to have Unix style line-endings.

I'm sorry for not attaching that file but I've now run cygcheck and attached
the output here.  I don't know if you can tell anything from it.
Unfortunately, I wouldn't know what to look for but  I'm sure this'll turn
out to be something fundamental though, like you said.

Thanks,

John


----- Original Message ----- 
From: "Phil Betts"
Sent: 22 September 2008 11:34
Subject: RE: g_assertions


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 115098 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20080922/14f9fbc0/attachment.obj>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list