# Installing 'win32-service-0.5.0' gives errors?

**URL:** <https://www.ruby-forum.com/t/installing-win32-service-0-5-0-gives-errors/94380>\
**Category:** Ruby\
**Created:** [May 3, 2006, 10:05am UTC](https://www.ruby-forum.com/t/installing-win32-service-0-5-0-gives-errors/94380 "2006-05-03T10:05:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![udinesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/a87d85/32.png) [@udinesh](https://www.ruby-forum.com/u/udinesh)\
**Post date:** [May 3, 2006, 10:05am UTC](https://www.ruby-forum.com/t/installing-win32-service-0-5-0-gives-errors/94380/1 "2006-05-03T10:05:18Z")

</div>

Hi all,

I’m trying to install the package “win32-service-0.5.0” on my system -  
XP. I’m getting the below errors

I Have downloaded the “win32-service-0.5.0” package and as per the  
readme i have to first execute the below command and when i do so, i’m  
getting the below error.

C:\DownloadDirector\win32-service-0.5.0\win32-service-0.5.0\>ruby  
extconf.rb  
checking for EnumServicesStatusEx()… no  
checking for QueryServiceStatusEx()… no  
creating Makefile

I think we should get ‘yes’ instead of ‘no’ above.

The mkmf.log file says the below error message

* * *

## have\_func: checking for EnumServicesStatusEx()… -------------------- no “cl -nologo -Feconftest -IC:/DownloadDirector/win32-service-0.5.0/win32-service-0.5.0 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -I./… -I./…/missing -MD -Zi -O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib advapi32.lib wsock32.lib -link -libpath:“c:/ruby/lib” -stack:0x2000000” conftest.c conftest.obj : error LNK2001: unresolved external symbol \_EnumServicesStatusEx conftest.exe : fatal error LNK1120: 1 unresolved externals checked program was: /\* begin _/ /top/ int main() { return 0; } int t() { EnumServicesStatusEx(); return 0; } /_ end _/ “cl -nologo -Feconftest -IC:/DownloadDirector/win32-service-0.5.0/win32-service-0.5.0 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -I./… -I./…/missing -MD -Zi -O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib advapi32.lib wsock32.lib -link -libpath:“c:/ruby/lib” -stack:0x2000000” conftest.c conftest.c(6) : error C2065: ‘EnumServicesStatusEx’ : undeclared identifier checked program was: /_ begin _/ #include \<winsock2.h\> #include \<windows.h\> /top/ int main() { return 0; } int t() { void ((volatile p)()); p = (void (()()))EnumServicesStatusEx; return 0; } /_ end \*/

## have\_func: checking for QueryServiceStatusEx()… -------------------- no “cl -nologo -Feconftest -IC:/DownloadDirector/win32-service-0.5.0/win32-service-0.5.0 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -I./… -I./…/missing -MD -Zi -O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib advapi32.lib wsock32.lib -link -libpath:“c:/ruby/lib” -stack:0x2000000” conftest.c conftest.obj : error LNK2001: unresolved external symbol \_QueryServiceStatusEx conftest.exe : fatal error LNK1120: 1 unresolved externals checked program was: /\* begin _/ /top/ int main() { return 0; } int t() { QueryServiceStatusEx(); return 0; } /_ end _/ “cl -nologo -Feconftest -IC:/DownloadDirector/win32-service-0.5.0/win32-service-0.5.0 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -I./… -I./…/missing -MD -Zi -O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib advapi32.lib wsock32.lib -link -libpath:“c:/ruby/lib” -stack:0x2000000” conftest.c conftest.c(6) : error C2065: ‘QueryServiceStatusEx’ : undeclared identifier checked program was: /_ begin _/ #include \<winsock2.h\> #include \<windows.h\> /top/ int main() { return 0; } int t() { void ((volatile p)()); p = (void (()()))QueryServiceStatusEx; return 0; } /_ end \*/

* * *

I have installed MS Visual Studio 2003 to get the CL compiler.

My Operating System is XP - SP2

Do we need to set any environemtn varibale before we run the above  
command.

Can you please help me out ?

Thank You

Note:- My requirment in that from my web page i need to call some ruby  
scipt sctipt to know about the status of a particular Services say “DB2”  
and display the same in the web page as Running or Stopped or Starting  
or Stopping etc as the states. So i think we can do this using the  
win32-service / 0.5.0 rt?

---

<div class="post-metadata">

**Author:** ![udinesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/a87d85/32.png) [@udinesh](https://www.ruby-forum.com/u/udinesh)\
**Post date:** [May 3, 2006, 7:06pm UTC](https://www.ruby-forum.com/t/installing-win32-service-0-5-0-gives-errors/94380/2 "2006-05-03T19:06:56Z")

</div>

Hi,

> C:\DownloadDirector\win32-service-0.5.0\win32-service-0.5.0\>ruby  
> extconf.rb  
> checking for EnumServicesStatusEx()… no  
> checking for QueryServiceStatusEx()… no  
> creating Makefile
> 
> I think we should get ‘yes’ instead of ‘no’ above.
> 
> The mkmf.log file says the below error message
> 
> * * *

…

> ((\*)()))QueryServiceStatusEx; return 0; }
> 
> Can you please help me out ?

It seems that you have several windows.h files.  
Check INCLUDE and LIB environment variable  
It should include something like this  
C:\Program Files\Microsoft Visual Studio .NET  
2003\VC7\PlatformSDK\include;

C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\lib;

In case of your failure,  
you can download binary file at  
[http://home.nownuri.net/~phasis/service.so](http://home.nownuri.net/~phasis/service.so)

> Note:- My requirment in that from my web page i need to call some ruby  
> scipt sctipt to know about the status of a particular Services say “DB2”  
> and display the same in the web page as Running or Stopped or Starting  
> or Stopping etc as the states. So i think we can do this using the  
> win32-service / 0.5.0 rt?

Yes, of course.

Regards,

Park H.
