Forum: Ruby Installing 'win32-service-0.5.0' gives errors ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dinesh U. (Guest)
on 2006-05-03 12:05
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?
Park H. (Guest)
on 2006-05-03 21:06
(Received via mailing list)
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

>
>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.
This topic is locked and can not be replied to.