Smiley argument in $(INCLUDES) when using in make(only in c++)

classic Classic list List threaded Threaded
5 messages Options
Tal
Reply | Threaded
Open this post in threaded view
|

Smiley argument in $(INCLUDES) when using in make(only in c++)

Tal
In the last thread here I showed this problem, in the last post:
http://mingw-users.1079350.n2.nabble.com/GLib-co-exiting-dependency-problem-kinda-my-fault-td6391226.html
The problem is that while compiling c++ packages via "make",
the Unicode smiley argument is stuck there, and it shows error:
gcc.exe: ☺: Invalid argument

I try to check how this smiley char is getting there, so I change
the "Makefile" file so I'll see which variable contain this. I have
found that it caused because the $(INCLUDES) var content:
-DG_LOG_DOMAIN=\"Gdk\" -DINSIDE_GDK_WIN32 -I../.. -I../../gdk -I../../gdk -DG_D
ISABLE_CAST_CHECKS -mms-bitfields -IC:/mingw/include/glib-2.0 -IC:/mingw/lib/gli
b-2.0/include -IC:/mingw/include/pango-1.0 -IC:/mingw/include/cairo -IC:/mingw/i
nclude/pixman-1 -IC:/mingw/include/freetype2 -IC:/mingw/include -IC:/mingw/inclu
de/libpng15 -IC:/noSpace/Programs/gdk-pixbuf/include/gdk-pixbuf-2.0  ☺   -DGDK_C
OMPILATION

This is it's specific content when compiling gtk+2.24.4. The
automake returns the error in the directory
"src/gtk+-2.24.4/gdk/win32". The content of $(INCLUDES)
when compiling Gdk-Pixbuf(in the last thread I mentioned above)
is different, but the same error occurred(Unicode smiley char).
I have install the minGW g++ package from mingw-get.
This error is only for c++. C packages are compiling fine.
Does anyone know how to fix $(INCLUDES) ? It's not shown in
"env" command.

Wait for your response,
Tal.
Reply | Threaded
Open this post in threaded view
|

Re: Smiley argument in $(INCLUDES) when using in make(only in c++)

Tor Lillqvist
> the Unicode smiley argument is stuck there, and it shows error:
> gcc.exe: ☺: Invalid argument

Actually it isn't the Unicode smiley (U+263A), but the character \001
(control-A) in the usual console output code page, CP437. They look
the same of course.

This is caused by a bug in MSYS, in some cases it inserts a \001
character in backtick expansions where there was a CR, or something
like that.

I think this was even discussed relatively recently on this list.

Personally I work around it by using a small shell script (which I
call /opt/local/bin/pkg-config.sh):

#!/bin/sh
export PATH=/devel/dist/win32/glib-2.20.3-1/bin:$PATH
if /devel/dist/win32/`latest pkg-config`/bin/pkg-config "$@" >
/dev/null 2>&1 ; then
   res=true
else
   res=false
fi
/devel/dist/win32/`latest pkg-config`/bin/pkg-config "$@" | tr -d \\r && $res

(I think this shell snippet was originally by Owen Taylor. The above
obviously uses some personal scripts and paths from my machine, modify
as necessary.)

and then set

export PKG_CONFIG=/opt/local/bin/pkg-config.sh

in my MSYS /etc/bash_profile.

More clever workarounds no doubt exist...

--tml

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Tal
Reply | Threaded
Open this post in threaded view
|

Re: Smiley argument in $(INCLUDES) when using in make(only in c++)

Tal
Thanks for your response.
I'm glad MSYS developer know about this, but I didn't
understand what shell I do.
You point there a script that add glib bin to PATH(I don't
need it, it is already set) and an if statement.
First, I think that yours "/devel/dist/win32/" is my "/mingw",
because I don't have this.
So far I understand, but I have some question, because
you told me to change this for my machine:
1. What does the 'latest pkg-config' means?
2. What does this "if" means? I don't have "/dev" dir so
 do I need this?

I think I understand the last line: you ask some output from
pkg-config and then delete the "\r" char(which solve this bug)
And this should be the new pkg-config server.
But how does pkg-config is related to the bug?
Sorry for asking beginner questions, but I still don't know
what does "$@" means.
Reply | Threaded
Open this post in threaded view
|

Re: Smiley argument in $(INCLUDES) when using in make(only in c++)

Tor Lillqvist
> You point there a script that add glib bin to PATH(I don't
> need it, it is already set)

As I said, the script is obviously dependent on details of my build
environment. I wanted this script to work in a "bare" environment with
no glib or anything in PATH already.

> First, I think that yours "/devel/dist/win32/" is my "/mingw",
> because I don't have this.

No it isn't but just ignore that, too.

I thought it would be easy to see what the script does in general and
filter out the specifics relevant just to my development environment,
but apparently not.

> 1. What does the 'latest pkg-config' means?

You don't need to know.

Here is a simplified version:

#!/bin/sh
if pkg-config "$@" > /dev/null 2>&1 ; then
   res=true
else
   res=false
fi
pkg-config "$@" | tr -d \\r && $res

> But how does pkg-config is related to the bug?

It isn't. It just happens to be the program that is invoked inside the
backticks.

> Sorry for asking beginner questions, but I still don't know
> what does "$@" means.

See http://www.gnu.org/software/bash/manual/bashref.html#Special-Parameters

--tml

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Smiley argument in $(INCLUDES) when using in make(only in c++)

Keith Marshall
In reply to this post by Tor Lillqvist
On 27/05/11 13:04, Tor Lillqvist wrote:

>> the Unicode smiley argument is stuck there, and it shows error:
>> gcc.exe: ☺: Invalid argument
>
> Actually it isn't the Unicode smiley (U+263A), but the character \001
> (control-A) in the usual console output code page, CP437. They look
> the same of course.
>
> This is caused by a bug in MSYS, in some cases it inserts a \001
> character in backtick expansions where there was a CR, or something
> like that.

That's an old bug; I thought it was fixed when we moved to bash-3.

The circumstances which trigger this bug are known, and explicit; it
arises when a back-quoted command expansion occurs within a double
quoted expression, and the enclosing expression runs on beyond the
closing back-quote, like this:

  "a `foo command expansion` within an outer expression"

The simple work around is to ensure that the enclosing expression does
NOT run on beyond the closing back-quote; writing the above as:

  "a `foo command expansion`"" within an outer expression"

avoids the issue, IIRC.

--
Regards,
Keith.

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe