Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
606 views
in Technique[技术] by (71.8m points)

windows - mingw make can't handle spaces in path?

I am trying to compile code, the makefile created using qmake. When I run mingw32-make I get the following error:

cd bzip2-1.0.5 && c:QtSDKDesktopQt4.7.3mingwinqmake.exe c:Documents an
d SettingsuserMy DocumentsVisual Studio 2010Projectsmeshlabmeshlabmeshla
bsrcexternalzip2-1.0.5zip2-1.0.5.pro -o Makefile
Cannot find file: c:Documents.
Cannot find file: and.
Cannot find file: SettingsuserMy.
Cannot find file: DocumentsVisual.
Cannot find file: Studio.
Cannot find file: 2010Projectsmeshlabmeshlabmeshlabsrcexternalzip2-1.0.5
zip2-1.0.5.pro.
mingw32-make: *** [bzip2-1.0.5Makefile] Error 2

By the error it appears that mingw32-make doesn't understand paths that have spaces in them. Is that true? Is there a way around it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The common way to do it in Linux/UNIX is to escape each space with a backslash, like: /c/Documents and Settings/User However, this doesn't always work in MinGW.

So, use the short (8.3) name. You get the short name with the Windows (not MinGW) command for %I in (<PATH>) do @echo %~sI where <PATH> can be . (show current directory, like pwd), * (list files in current directory), a particular file path, etc.

Btw, to copy from the awful cmd.exe window, click the icon in the upper-left corner of the title bar, go to Properties, Options, and enable QuickEdit Mode. Then you can select text with your mouse. The Enter key (or menu>Edit>Copy) copies the text to the clipboard. The insert key (or menu>Edit>Paste) pastes it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...