mingw make can't handle spaces in path?

后端 未结 4 453
抹茶落季
抹茶落季 2020-12-07 01:08

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:\\QtSDK\\Desk         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-07 01:22

    Sorry for necroing this, but I had a similar problem and I was able to fix it using cygpath.

    For my case I was trying to make an environment variable to visual studio:

    export DEVENV="/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/devenv.com
    echo $DEVENV
    $DEVENV $1 /build "Release|win64"
    

    Which would result in:

    /c/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/devenv.com
    -bash: /c/Program: No such file or directory
    

    The solution was to use cygpath -w to convert the path with spaces into an 8.3 filename:

    export DEVENV=$(cygpath -w -s "/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/devenv.com")
    echo $DEVENV
    $DEVENV $1 /build "Release|win64"
    

    Which results in:

    C:\PROGRA~2\MICROS~1\2019\COMMUN~1\Common7\IDE\devenv.com
    

    and no error. Hopefully this helps future travellers.

提交回复
热议问题