Maher4Ever / wdm

Windows Directory Monitor (WDM) is a threaded directories monitor for Windows.
https://rubygems.org/gems/wdm
MIT License
51 stars 15 forks source link

use gem install wdm in cygwin failed(ruby 2.3.3p222 x86_64-cygwin, win10) #26

Open heropoo opened 6 years ago

heropoo commented 6 years ago

when I use gem install wdm in cygwin got this error.

$ gem install wdm
Building native extensions.  This could take a while...
ERROR:  Error installing wdm:
        ERROR: Failed to build gem native extension.

    current directory: /home/admin/.gem/ruby/2.3.0/gems/wdm-0.1.1/ext/wdm
/usr/bin/ruby.exe -r ./siteconf20180110-13248-1jtp7ej.rb extconf.rb
checking for main() in -lkernel32... yes
checking for windows.h... yes
checking for ruby.h... yes
checking for HAVE_RUBY_ENCODING_H... yes
checking for rb_thread_call_without_gvl()... yes
creating Makefile

current directory: /home/admin/.gem/ruby/2.3.0/gems/wdm-0.1.1/ext/wdm
make "DESTDIR=" clean
rm -f
rm -f wdm_ext.so  *.o  *.bak mkmf.log .*.time

current directory: /home/admin/.gem/ruby/2.3.0/gems/wdm-0.1.1/ext/wdm
make "DESTDIR="
gcc -I. -I/usr/include/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -DHAVE_RB_THREAD_CALL_WITHOUT_GVL     -ggdb -O2 -pipe -Wimplicit-function-declaration    -o entry.o -c entry.c
gcc -I. -I/usr/include/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -DHAVE_RB_THREAD_CALL_WITHOUT_GVL     -ggdb -O2 -pipe -Wimplicit-function-declaration    -o memory.o -c memory.c
gcc -I. -I/usr/include/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -DHAVE_RB_THREAD_CALL_WITHOUT_GVL     -ggdb -O2 -pipe -Wimplicit-function-declaration    -o monitor.o -c monitor.c
gcc -I. -I/usr/include/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -DHAVE_RB_THREAD_CALL_WITHOUT_GVL     -ggdb -O2 -pipe -Wimplicit-function-declaration    -o queue.o -c queue.c
queue.c: In function ‘wdm_queue_item_error_new’:
queue.c:28:14: warning: implicit declaration of function ‘_vscprintf’ [-Wimplicit-function-declaration]
     length = _vscprintf(format, ap);
              ^~~~~~~~~~
gcc -I. -I/usr/include/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -DHAVE_RB_THREAD_CALL_WITHOUT_GVL     -ggdb -O2 -pipe -Wimplicit-function-declaration    -o rb_change.o -c rb_change.c
rb_change.c: In function ‘extract_absolute_path_from_notification’:
rb_change.c:47:16: error: ‘_MAX_FNAME’ undeclared (first use in this function)
     WCHAR file[_MAX_FNAME], ext[_MAX_EXT], filename[WDM_MAX_FILENAME];
                ^~~~~~~~~~
rb_change.c:47:16: note: each undeclared identifier is reported only once for each function it appears in
rb_change.c:47:33: error: ‘_MAX_EXT’ undeclared (first use in this function)
     WCHAR file[_MAX_FNAME], ext[_MAX_EXT], filename[WDM_MAX_FILENAME];
                                 ^~~~~~~~
rb_change.c:74:5: warning: implicit declaration of function ‘_wsplitpath’ [-Wimplicit-function-declaration]
     _wsplitpath(buffer, NULL, NULL, file, ext);
     ^~~~~~~~~~~
make: *** [Makefile:240: rb_change.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/admin/.gem/ruby/2.3.0/gems/wdm-0.1.1 for inspection.
Results logged to /home/admin/.gem/ruby/2.3.0/extensions/x86_64-cygwin/2.3.0/wdm-0.1.1/gem_make.out

how to fix it?