Bug 379427 - 'C:\Program' not recognized as internal or external command in compilation of zlib.
Summary: 'C:\Program' not recognized as internal or external command in compilation of...
Status: RESOLVED NOT A BUG
Alias: None
Product: kde-windows
Classification: Miscellaneous
Component: buildsystem (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR critical
Target Milestone: ---
Assignee: KDE-Windows
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-02 02:42 UTC by R030t1
Modified: 2017-05-03 07:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
log-C_KDE.txt (2.10 MB, text/plain)
2017-05-02 02:42 UTC, R030t1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description R030t1 2017-05-02 02:42:50 UTC
Created attachment 105306 [details]
log-C_KDE.txt

I can guess what is causing this (a typo) but am not really aware of any way to fix it. This only occurs when using MSVCC - I switched from MinGW to avoid Bug 379142.
Comment 1 Kevin Funk 2017-05-02 22:53:55 UTC
Error:
2017-05-01 19:35:51,534 INFO FAILED: zlib1rc.obj
2017-05-01 19:35:51,534 INFO cmd.exe /C "cd /D R:\build\win32libs\zlib\work\msvc2015-RelWithDebInfo-1.2.8 && "C:\Program Files\mingw-w64\x86_64-6.3.0-win32-seh-rt_v5-rev1\mingw64\bin\windres.exe" -D GCC_WINDRES -I R:/build/win32libs/zlib/work/zlib-1.2.8 -I R:/build/win32libs/zlib/work/msvc2015-RelWithDebInfo-1.2.8 -o R:/build/win32libs/zlib/work/msvc2015-RelWithDebInfo-1.2.8/zlib1rc.obj -i R:/build/win32libs/zlib/work/zlib-1.2.8/win32/zlib1.rc"
2017-05-01 19:35:51,534 INFO 'C:\Program' is not recognized as an internal or external command,
2017-05-01 19:35:51,534 INFO 
2017-05-01 19:35:51,534 INFO operable program or batch file.
2017-05-01 19:35:51,534 INFO 
2017-05-01 19:35:51,534 INFO C:\Program Files\mingw-w64\x86_64-6.3.0-win32-seh-rt_v5-rev1\mingw64\bin\windres.exe: preprocessing failed.
2017-05-01 19:35:51,534 INFO
Comment 2 Kevin Funk 2017-05-02 23:28:57 UTC
Upstream issue in zlib: From the root CMakeLists.txt:
```
    add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
                       COMMAND ${CMAKE_RC_COMPILER}
                            -D GCC_WINDRES
                            -I ${CMAKE_CURRENT_SOURCE_DIR}
                            -I ${CMAKE_CURRENT_BINARY_DIR}
                            -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
                            -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
```

=> MinGW Makefiles code generated by CMake does not properly escape the path containing spaces for CMAKE_RC_COMPILER, thus fails the compilation.

Fix: Don't install MinGW in a path containing spaces. It's as easy as that. The MinGW project itself recommends against it, see e.g.:
  http://stackoverflow.com/questions/5999507/mingw-make-cant-handle-spaces-in-path
Comment 3 R030t1 2017-05-03 02:31:01 UTC
Per the submission comment I was trying to use MSVCC - any idea why MinGW was pulled in? Any idea why MinGW compiles the exact same package successfully when installed in that location if MinGW is set explicitly?
Comment 4 R030t1 2017-05-03 02:33:13 UTC
I am confused because the installer defaults to "C:\Program Files" and because many Unix programs support spaces in file names (note the linked article is a decade old). Also, I told the setup script to use the Microsoft C compiler.
Comment 5 Hannah von Reth 2017-05-03 07:41:01 UTC
Please remove mingw-w64 6.3 from your path.
We only support the mings version installed by craft.