Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

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

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

From: Frank Maier

Date: 25 Jan, 2010 14:14:04

Message: 1 of 7

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

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

From: Jos (10584)

Date: 25 Jan, 2010 15:21:02

Message: 2 of 7

"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

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

From: ImageAnalyst

Date: 25 Jan, 2010 15:42:13

Message: 3 of 7

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?

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

From: Frank Maier

Date: 25 Jan, 2010 16:46:02

Message: 4 of 7

> 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

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

From: Frank Maier

Date: 25 Jan, 2010 16:50:21

Message: 5 of 7

> 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

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

From: dpb

Date: 25 Jan, 2010 21:52:21

Message: 6 of 7

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?

--

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

From: Frank

Date: 27 Jan, 2010 08:12:04

Message: 7 of 7

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

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us