[Interest] Fwd: Defining a string in qmake command line
Soroush Rabiei
soroush.rabiei at gmail.com
Thu Jan 23 20:35:26 CET 2014
---------- Forwarded message ----------
From: Soroush Rabiei <soroush.rabiei at gmail.com>
Date: Thu, Jan 23, 2014 at 10:14 PM
Subject: Re: [Interest] Defining a string in qmake command line
To: Thiago Macieira <thiago.macieira at intel.com>
On Thu, Jan 23, 2014 at 9:01 PM, Thiago Macieira
<thiago.macieira at intel.com>wrote:
> On quinta-feira, 23 de janeiro de 2014 09:01:43, Thiago Macieira wrote:
> > If you're running from the command-line, you need to escape it further:
> >
> > qmake 'DEFINES+=SERIAL=\\\"f9a/z\\\"'
> > or
> > qmake DEFINES+=SERIAL=\\\\\\"f9a/z\\\\\\"
>
> I should have tested before sending. The number of backslashes is wrong.
> You
> need 7, not 6:
>
> $ ls \\\\\\\"a\\\\\\\"
> ls: cannot access \\\"a\\\": No such file or directory
>
> Exercise left to the reader: why didn't I check with echo?
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
> Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
The problem is that bash (or qmake) eats the double quotation. Definition
needs to be wrapped in quotations. So it should pass to compiler something
like:
-DSERIAL\"6b6ab0\"
Because I'm using serial number in my code as a private key:
HexDecoder decoder;
decoder.Put( (byte *)SERIAL,32*2 );
decoder.MessageEnd();
word64 size = decoder.MaxRetrievable();
Note: I've changed requirements to restrict input string to be a
hex-encoded, 32 byte key to avoid any problems with base64.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140123/9c545b73/attachment.html>
More information about the Interest
mailing list