[Win32utils-devel] [ win32utils-Support Requests-24279 ] Windows 7 x64 - building a win32-api gem on windows

noreply at rubyforge.org noreply at rubyforge.org
Mon Mar 30 13:34:48 EDT 2009


Support Requests item #24279, was opened at 2009-03-03 06:51
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=412&aid=24279&group_id=85

Category: win32-api
Group: v1.0 (example)
Status: Open
Resolution: None
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: Windows 7 x64 - building a win32-api gem on windows

Initial Comment:
Hi Guys,

I have been trying to install win32-api 1.4.0 gem on windows 7 x64 but
no success.

When i install x86 version, require 'win32/api' gives me following
error:

LoadError: 193: %1 is not a valid Win32 application.   -
c:/ruby/lib/ruby/gems/1.9.1/gems/win32-api-1.4.0-x86-mswin32-60/lib/win32/api.so
        from (irb):1:in `require'
        from (irb):1
        from c:/ruby/bin/irb.bat:20:in `<main>'

My ruby:
ruby 1.9.1p0 (2009-01-30 revision 21907) [x64-mswin64_80]

My gems:
1.3.1

I have VS2008 installed and even managed to create a makefile but it
complains about following:

C:\>gem install win32-api
Building native extensions.  This could take a while...
ERROR:  Error installing win32-api:
        ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb install win32-api
checking for strncpy_s()... yes
creating Makefile

nmake

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

        c:\ruby\bin\ruby -e "puts 'EXPORTS', 'Init_api'"  >
api-x64-mswin64_80.def
        cl -nologo -I. -Ic:/ruby/include/ruby-1.9.1/x64-mswin64_80
-Ic:/ruby/include/ruby-1.9.1/ruby/backward -Ic:/ruby/include/ruby-1.9.1
-Iwin32 -MD -Zi  -O2b
2xty-  -Zm600 -DHAVE_STRNCPY_S -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE -Foapi.obj -c -Tcwin32/api.c
api.c
        cl -nologo -LD -Feapi.so api.obj msvcr80-ruby191.lib
oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib   -link
-incremental:no -debug -opt:re
f -opt:icf -dll -libpath:"." -libpath:"c:/ruby/lib"
-implib:api-x64-mswin64_80.lib -pdb:api-x64-mswin64_80.pdb
-def:api-x64-mswin64_80.def
   Creating library api-x64-mswin64_80.lib and object
api-x64-mswin64_80.exp
api.obj : error LNK2019: unresolved external symbol _rb_num2long
referenced in function _NUM2LONG
api.obj : error LNK2019: unresolved external symbol _rb_int2big
referenced in function _LONG2NUM
api.obj : error LNK2019: unresolved external symbol _rb_uint2big
referenced in function _ULONG2NUM
api.obj : error LNK2019: unresolved external symbol
_rb_data_object_alloc referenced in function _api_allocate
api.obj : error LNK2019: unresolved external symbol _rb_raise referenced
in function _StringError
api.obj : error LNK2019: unresolved external symbol _rb_iv_set
referenced in function _callback_init
api.obj : error LNK2019: unresolved external symbol _rb_str_new_cstr
referenced in function _callback_init
api.obj : error LNK2019: unresolved external symbol _rb_scan_args
referenced in function _callback_init
api.obj : error LNK2019: unresolved external symbol _rb_string_value_ptr
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_str_cat
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_str_new_shared
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_check_safe_obj
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_string_value
referenced in function _api_init
api.obj : error LNK2001: unresolved external symbol __imp__rb_eArgError
api.obj : error LNK2019: unresolved external symbol _rb_ary_push
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_ary_new
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_str_split
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_respond_to
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_intern
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_check_type
referenced in function _api_init
api.obj : error LNK2019: unresolved external symbol _rb_str_modify
referenced in function _CallbackFunction
api.obj : error LNK2019: unresolved external symbol _rb_num2ulong
referenced in function _CallbackFunction
api.obj : error LNK2019: unresolved external symbol _rb_funcall2
referenced in function _CallbackFunction
api.obj : error LNK2019: unresolved external symbol _rb_iv_get
referenced in function _CallbackFunction
api.obj : error LNK2019: unresolved external symbol _rb_str_new
referenced in function _api_call
api.obj : error LNK2019: unresolved external symbol _rb_define_const
referenced in function _Init_api
api.obj : error LNK2019: unresolved external symbol _rb_define_attr
referenced in function _Init_api
api.obj : error LNK2019: unresolved external symbol _rb_define_method
referenced in function _Init_api
api.obj : error LNK2019: unresolved external symbol
_rb_define_alloc_func referenced in function _Init_api
api.obj : error LNK2001: unresolved external symbol
__imp__rb_eRuntimeError
api.obj : error LNK2019: unresolved external symbol
_rb_define_class_under referenced in function _Init_api
api.obj : error LNK2001: unresolved external symbol __imp__rb_cObject
api.obj : error LNK2019: unresolved external symbol _rb_define_module
referenced in function _Init_api
api.so : fatal error LNK1120: 33 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.


Gem files will remain installed in
c:/ruby/lib/ruby/gems/1.9.1/gems/win32-api-1.4.0 for inspection.
Results logged to
c:/ruby/lib/ruby/gems/1.9.1/gems/win32-api-1.4.0/ext/gem_make.out


Does anyone have any idea about building gem on windows? Or maybe you
have precompiled api.so on your x64 system.

I would appreciate your help.

----------------------------------------------------------------------

>Comment By: Daniel Berger (djberg96)
Date: 2009-03-30 10:34

Message:
Wow, I'm not sure at this point. I've built it without issue on x64 Vista, but I simply don't have access to Windows 7 to comment further. I'm afraid we really can't support Windows 7 until it's officially released.

Regards,

Dan

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=412&aid=24279&group_id=85


More information about the win32utils-devel mailing list