[Scons-users] error: stray '\' in program

Mahmood Naderan nt_mahmood at yahoo.com
Sat Apr 19 06:17:51 EDT 2014


It seems that replacing 'echo' with 'echo -e' resolves the issue.

Thanks

 
Regards,
Mahmood
On Saturday, April 19, 2014 2:04 PM, Dirk Baechle <tshortik at gmx.de> wrote:

Hi Mahmood,


Am 19.04.2014 10:06, schrieb Mahmood Naderan:

Hi

>While compiling a program with scons, I get these errors

>

>    build/opt/zsim_harness.cpp:315:5: error: stray '\' in

program

>    build/opt/zsim_harness.cpp:315:5: error: stray '#' in

program

>    build/opt/zsim_harness.cpp: In function 'int main(int,

char**)':

>    build/opt/zsim_harness.cpp:310:24: error:

'ZSIM_BUILDVERSION' was not declared in this  scope

>    build/opt/zsim_harness.cpp:315:5: error: expected ')' before

'n'

>    build/opt/zsim_harness.cpp:315:5: error: 'ZSIM_BUILDVERSION'

was not declared in this scope

>

>The line that has such bug contains

>

>    info("Starting zsim, built %s (rev %s)", ZSIM_BUILDDATE,

ZSIM_BUILDVERSION);

>

>`ZSIM_BUILDVERSION` is a macro which is defined in SConstruct

>

>    if os.path.exists(".git"):

>        env.Command(versionFile, allSrcs + [".git/index",

"SConstruct"],

>            'echo "#define ZSIM_BUILDDATE

\\""`date`\\""\\\\n#define ZSIM_BUILDVERSION \\""`python
misc/gitver.py`\\""" >>' + versionFile)

>    else:

>        env.Command(versionFile, allSrcs + ["SConstruct"],

>            'echo "#define ZSIM_BUILDDATE

\\""`date`\\""\\\\n#define ZSIM_BUILDVERSION \\""no git
repo\\""" >>' + versionFile)

>

>The generated output looks like

>

> 

>    #define ZSIM_BUILDDATE "Sat Apr 19 12:32:10 CET

2014"\n#define ZSIM_BUILDVERSION "master:10:a8c417b:2fc 2+ 1-
ba884341"

>

>

>The scons version is 2.1.0

>Any idea to fix that?

>

>

>

yes, you have to change your "echo" command, such that the output
into the versionFile gets split into two lines with a single #define
each. Try out the "echo" line in your shell first, to make sure it
works. Then copy it back to the Command() call in your SConstruct.

Best regards,

Dirk


_______________________________________________
Scons-users mailing list
Scons-users at scons.org
http://four.pairlist.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140419/9708d4c0/attachment-0001.html


More information about the Scons-users mailing list