This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]