pmq20 / ruby-packer

Packing your Ruby application into a single executable.
MIT License
1.56k stars 99 forks source link

Windows: Cannot open include file: 'zlib.h' #34

Closed tomdalling closed 4 years ago

tomdalling commented 6 years ago

Hi,

I'm having trouble getting rubyc to compile my project on Windows. It works fine on OS X.

It appears that the zlib header is missing. I thought it might be in the C:\Users\Tom\AppData\Local\Temp\rubyc\zlib directory, but it isn't.

Any ideas?

Command Line Output

C:\Users\Tom\proj\interwang>rubyc bin\interwang.rb
-> Project root not supplied, C:/Users/Tom/proj/interwang assumed.
Ruby Compiler (rubyc) v0.4.0
- entrance: C:/Users/Tom/proj/interwang/bin/interwang.rb
- options: {:make_args=>"-j4", :output=>"C:/Users/Tom/proj/interwang/a.exe", :tmpdir=>"C:/Users/Tom/AppData/Local/Temp/rubyc"}

-> mkdir -p C:/Users/Tom/AppData/Local/Temp/rubyc
-> cp -r "C:/__enclose_io_memfs__/local/ruby" "C:/Users/Tom/AppData/Local/Temp/rubyc/ruby-2.4.1-0.4.0"
-> cd C:/Users/Tom/AppData/Local/Temp/rubyc/ruby-2.4.1-0.4.0
-> cd C:/Users/Tom/proj/interwang
-> cd C:/Users/Tom/AppData/Local/Temp/rubyc/ruby-2.4.1-0.4.0
-> Running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "call win32\\configure.bat                                   --disable-install-doc                                   --prefix=\"C:/Users/Tom/AppData/Local/Temp/rubyc/ruby-2.4.1-0.4.0/build\""]
Creating verconf.mk
Creating Makefile.new
"type `nmake' to make ruby."
-> Running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "nmake "]

Microsoft (R) Program Maintenance Utility Version 14.12.25835.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        CC = cl -nologo
        LD = cl -nologo
        LDSHARED = cl -nologo -LD
        CFLAGS = -MD -Zi -W2 -wd4100 -wd4127 -wd4210 -wd4214 -wd4255 -wd4574  -wd4668 -wd4710 -wd4711 -wd4820 -wd4996  -we4028 -we4142 -O2sy-  -Zm600  -MD /Ox  -I"C:/Users/Tom/AppData/Local/Temp/rubyc/zlib"
        XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/i386-mswin32_140 -I./include -I. -I./enc/unicode/9.0.0  -MD /Ox  -I"C:/Users/Tom/AppData/Local/Temp/rubyc/zlib"
 CPPFLAGS = -D_WIN32_WINNT=0x0600
 DLDFLAGS = -incremental:no -debug -opt:ref -opt:icf -libpath:"C:\Users\Tom\AppData\Local\Temp\rubyc\zlib" "C:/Users/Tom/AppData/Local/Temp/rubyc/zlib/zlib.lib" -dll
 SOLIBS =
generating known_errors.inc
known_errors.inc unchanged
file2lastrev.rb: does not seem to be under a vcs: .
./revision.h unchanged
generating id.h
id.h updated
Creating config.h
.ext\include\i386-mswin32_140\ruby\config.h updated
Creating config.status
compiling main.c
main.c
c:\users\tom\appdata\local\temp\rubyc\ruby-2.4.1-0.4.0\include\enclose_io_win32.h(24): warning C4005: 'stat': macro redefinition
c:\users\tom\appdata\local\temp\rubyc\ruby-2.4.1-0.4.0\include\ruby/win32.h(171): note: see previous definition of 'stat'
c:\users\tom\appdata\local\temp\rubyc\ruby-2.4.1-0.4.0\include\enclose_io_win32.h(25): warning C4005: 'fstat': macro redefinition
c:\users\tom\appdata\local\temp\rubyc\ruby-2.4.1-0.4.0\include\ruby/win32.h(172): note: see previous definition of 'fstat'
compiling dmydln.c
dmydln.c
compiling miniruby.rc
compiling miniinit.c
miniinit.c
compiling dmyext.c
dmyext.c
generating miniprelude.c
miniprelude.c updated
compiling miniprelude.c
miniprelude.c
compiling autoupdate_autoupdate.c
autoupdate_autoupdate.c
autoupdate_autoupdate.c(10): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\cl.EXE"' : return code '0x2'
Stop.
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "nmake "]

Contents of zlib directory

Directory of C:\Users\Tom\AppData\Local\Temp\rubyc\zlib

2018-02-12  17:51    <DIR>          .
2018-02-12  17:51    <DIR>          ..
2017-08-14  20:08             5,204 adler32.c
2017-08-14  20:08    <DIR>          amiga
2017-08-14  20:08            78,553 ChangeLog
2017-08-14  20:08             8,099 CMakeLists.txt
2017-08-14  20:08             2,699 compress.c
2017-08-14  20:08            28,244 configure
2018-02-12  17:51    <DIR>          contrib
2017-08-14  20:08            16,573 FAQ
2017-08-14  20:08             1,988 INDEX
2017-08-14  20:08               100 Makefile
2017-08-14  20:08            13,680 Makefile.in
2017-08-14  20:08             5,187 README
              10 File(s)        160,327 bytes
AakLak commented 6 years ago

Similar error, maybe related?

linking miniruby.exe
LINK : fatal error LNK1181: cannot open input file 'C:\Users\yohoj\AppData\Local\Temp\rubyc\zlib\zlib.lib'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.EXE"' : return code '0x2'
Stop.
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "nmake "]
tomdalling commented 4 years ago

Closing due to age