'c:\Program' is not recognized as an ...

  • Follow


Hello,

I'm wondering very much that I'm the only one having this problem (but I couldn't find any other posts in this forum):

- I use  a simple simulink model, no changes made to the configuration
- Trying to build with Realtimeworkshop a executable (grt-target)

Matlab is 2009a, but the problem occurred also in earlier versions.

Trying to build it yields the error message:

'c:\Program' is not recognized as an internal or external command, 

The problem is related to the batchfile untitled.bat, which is called to start the execution of the makefile:

set MATLAB=e:\Program Files\MATLAB\R2009a
c:\Program Files\MATLAB\R2009a\bin\win64\gmake -f untitled.mk  .....
   ... GENERATE_REPORT=0

The second line tries to execute gmake, but the interpreter stops after the first space, trying to interprete c:\program as a program, which is not. Putting double quotes around it "c:\Program Files\MATLAB\R2009a\bin\win64\gmake" works fine. But the batchfile is rebuild everytime the build button is pressed. Not a feasible solution.
Any ideas how to solve this problem permanently ?

BR
Frank
0
Reply Frank 1/25/2010 2:14:04 PM

"Frank Maier" <frankm@dopedoo.de> wrote in message <hjk8vc$j4j$1@fred.mathworks.com>...
> Hello,
> 
> I'm wondering very much that I'm the only one having this problem (but I couldn't find any other posts in this forum):
> 
> - I use  a simple simulink model, no changes made to the configuration
> - Trying to build with Realtimeworkshop a executable (grt-target)
> 
> Matlab is 2009a, but the problem occurred also in earlier versions.
> 
> Trying to build it yields the error message:
> 
> 'c:\Program' is not recognized as an internal or external command, 
> 
> The problem is related to the batchfile untitled.bat, which is called to start the execution of the makefile:
> 
> set MATLAB=e:\Program Files\MATLAB\R2009a
> c:\Program Files\MATLAB\R2009a\bin\win64\gmake -f untitled.mk  .....
>    ... GENERATE_REPORT=0
> 
> The second line tries to execute gmake, but the interpreter stops after the first space, trying to interprete c:\program as a program, which is not. Putting double quotes around it "c:\Program Files\MATLAB\R2009a\bin\win64\gmake" works fine. But the batchfile is rebuild everytime the build button is pressed. Not a feasible solution.
> Any ideas how to solve this problem permanently ?
> 
> BR
> Frank

This is a windows problem, not a matlab problem. If you put double quotes around the strings it might work:

set MATLAB="e:\Program Files\MATLAB\R2009a"
"c:\Program Files\MATLAB\R2009a\bin\win64\gmake" -f "untitled.mk"

hth
Jos
0
Reply Jos 1/25/2010 3:21:02 PM


Frank:
You say that it works fine with the quotes . . . so why is this not a
feasible solution?

What do you mean by "But the batchfile is rebuild everytime the build
button is pressed."?  And why would that be a problem?

0
Reply ImageAnalyst 1/25/2010 3:42:13 PM

> What do you mean by "But the batchfile is rebuild everytime the build
> button is pressed."?  And why would that be a problem?

Well, I put quotes around the gmake call, and it works. Then I change model, I rebuild the code, and the batch file is recreated (from rtw, without quotes). So I have to add again quotes to the batchfile.

It can't be that all rtw users are everytime adding quotes after they hit strg-c (at least those who install the matlab software in a default location like c:\program files).

BR
Frank
0
Reply Frank 1/25/2010 4:46:02 PM

> This is a windows problem, not a matlab problem. If you put double quotes around the strings it might work:

as I mentioned, it does work, but you have to do that every time after you hit strg-b or press the build button (because the batch is rebuild every time, too).

Who cares if it is a dos or matlab problem, I want a smooth procedure to generate and compile code without editing every time code or batch files.

I would expect that grt is creating a valid batch file. I wonder if the whole world is installing matlab always in c:\matlab.

BR
Frank
0
Reply Frank 1/25/2010 4:50:21 PM

Frank Maier wrote:
....
> Well, I put quotes around the gmake call, and it works. Then I change 
> model, I rebuild the code, and the batch file is recreated (from rtw, 
> without quotes). So I have to add again quotes to the batchfile.
> 
> It can't be that all rtw users are everytime adding quotes after they 
> hit strg-c (at least those who install the matlab software in a default 
> location like c:\program files).
> 
> BR
> Frank

Seems like a formal contact/support issue to TMW.  Not having Simulink 
nor RTW, can't comment otherwise.

Altho a question...does the content of the batch file actually change? 
Would seem that only the contents of the model files would change unless 
added/subtracted a file from the project.  So, can you save the batch 
file after the correction w/ a different name and ignore the new one?

Or, could you write another higher level file that is invoked that makes 
the fixup automagically perhaps as another possible workaround?

Have you looked for a bug report/workaround at TMW?

--
0
Reply dpb 1/25/2010 9:52:21 PM

Finally solved.

Just in case someones runs into similar problems: I'm creating a target for a realtime linux machine. So I used the grt_unix.tmf, but as I'm using a crosscompiler on Win OS I mixed it up with grt_vcc.tmf.

The command of interest in the tmf file is 

MAKECMD         = |>ALT_MATLAB_BIN<|/|>ARCH<|/gmake

The batch file's second line will be created from this command. You must use the version with ALT_.... for the path, that are the old dos style paths.

And as I have bothered you for nothing another small tip: If you have a crosscompiler and you want to set a path to it, you can also use the MAKECMD. Simply set up the new path variable in front of the call to gmake:

MAKECMD         = set PATH=%PATH%;|>MATLAB_ROOT<|\toolbox\xxxx\cygwin\bin& |>ALT_MATLAB_BIN<|/|>ARCH<|/gmake

be careful not to place a space after bin and before &, as this would be interpreted as part of the path (the & seperates multiple commands in dos).

BR
Frank
0
Reply nospam6181 (3) 1/27/2010 8:12:04 AM

6 Replies
413 Views

(page loaded in 0.067 seconds)

Similiar Articles:













7/23/2012 4:09:48 PM


Reply: