Daniel Berger
2009-Jun-24 16:25 UTC
[Win32utils-devel] Possible problem with msvcrt vs msvcrXX
Hi, I tried this with a version of Ruby I built with VC++ 2008: irb(main):005:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcrt'') => #<Win32::API:0x4774684> irb(main):006:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcr90'') Win32::API::LoadLibraryError: LoadLibrary() function failed for ''msvcr90'': The specified module could not be found. from (irb):6:in `initialize'' from (irb):6:in `new'' from (irb):6 Do I have an environment issue? Do we need to revisit windows-api with regards to how it sets MSVCRT_DLL? Regards, Dan
Heesob Park
2009-Jun-25 01:28 UTC
[Win32utils-devel] Possible problem with msvcrt vs msvcrXX
Hi, 2009/6/25 Daniel Berger <djberg96 at gmail.com>:> Hi, > > I tried this with a version of Ruby I built with VC++ 2008: > > irb(main):005:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcrt'') > => #<Win32::API:0x4774684> > > irb(main):006:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcr90'') > Win32::API::LoadLibraryError: LoadLibrary() function failed for ''msvcr90'': > The specified module could not be found. > ? ? ? ?from (irb):6:in `initialize'' > ? ? ? ?from (irb):6:in `new'' > ? ? ? ?from (irb):6 > > Do I have an environment issue? Do we need to revisit windows-api with > regards to how it sets MSVCRT_DLL? >I remember I saw almost same issue a few years ago :) MSVCR90.dll is not installed in system32, but in the side-by-side folder, hence the manifest is required. Create ''ruby.exe.manifest'' in the ruby''s bin folder like this: mt -inputresource:ruby.exe;2 -out:ruby.exe.manifest Regards, Park Heesob
Daniel Berger
2009-Jun-25 02:49 UTC
[Win32utils-devel] Possible problem with msvcrt vs msvcrXX
> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils-devel- > bounces at rubyforge.org] On Behalf Of Heesob Park > Sent: Wednesday, June 24, 2009 7:28 PM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Possible problem with msvcrt vs msvcrXX > > Hi, > > 2009/6/25 Daniel Berger <djberg96 at gmail.com>: > > Hi, > > > > I tried this with a version of Ruby I built with VC++ 2008: > > > > irb(main):005:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcrt'') > > => #<Win32::API:0x4774684> > > > > irb(main):006:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcr90'') > > Win32::API::LoadLibraryError: LoadLibrary() function failed for > ''msvcr90'': > > The specified module could not be found. > > from (irb):6:in `initialize'' > > from (irb):6:in `new'' > > from (irb):6 > > > > Do I have an environment issue? Do we need to revisit windows-api > with > > regards to how it sets MSVCRT_DLL? > > > I remember I saw almost same issue a few years ago :) > > MSVCR90.dll is not installed in system32, but in the side-by-side > folder, hence the manifest is required. > > Create ''ruby.exe.manifest'' in the ruby''s bin folder like this: > mt -inputresource:ruby.exe;2 -out:ruby.exe.manifestThe ruby.exe.manifest *does* exist. I checked. It''s also checked in the windows-api code: # With Microsoft Visual C++ 8 and later users should use the associated # DLL instead of msvcrt directly, if possible. if CONFIG[''host_os''].split(''_'')[1] if CONFIG[''host_os''].split(''_'')[1].to_i >= 80 && File.exists?(File.join(CONFIG[''bindir''], ''ruby.exe.manifest'')) then MSVCRT_DLL = ''msvcr'' + CONFIG[''host_os''].split(''_'')[1] else MSVCRT_DLL = ''msvcrt'' end else MSVCRT_DLL = ''msvcrt'' end Regards, Dan
Heesob Park
2009-Jun-25 03:19 UTC
[Win32utils-devel] Possible problem with msvcrt vs msvcrXX
Hi, 2009/6/25 Daniel Berger <djberg96 at gmail.com>:> > >> -----Original Message----- >> From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils-devel- >> bounces at rubyforge.org] On Behalf Of Heesob Park >> Sent: Wednesday, June 24, 2009 7:28 PM >> To: Development and ideas for win32utils projects >> Subject: Re: [Win32utils-devel] Possible problem with msvcrt vs msvcrXX >> >> Hi, >> >> 2009/6/25 Daniel Berger <djberg96 at gmail.com>: >> > Hi, >> > >> > I tried this with a version of Ruby I built with VC++ 2008: >> > >> > irb(main):005:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcrt'') >> > => #<Win32::API:0x4774684> >> > >> > irb(main):006:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcr90'') >> > Win32::API::LoadLibraryError: LoadLibrary() function failed for >> ''msvcr90'': >> > The specified module could not be found. >> > ? ? ? ?from (irb):6:in `initialize'' >> > ? ? ? ?from (irb):6:in `new'' >> > ? ? ? ?from (irb):6 >> > >> > Do I have an environment issue? Do we need to revisit windows-api >> with >> > regards to how it sets MSVCRT_DLL? >> > >> I remember I saw almost same issue a few years ago :) >> >> MSVCR90.dll is not installed in system32, but in the side-by-side >> folder, hence the manifest is required. >> >> Create ''ruby.exe.manifest'' in the ruby''s bin folder like this: >> mt -inputresource:ruby.exe;2 -out:ruby.exe.manifest > > The ruby.exe.manifest *does* exist. I checked. It''s also checked in the windows-api code: > > ? # With Microsoft Visual C++ 8 and later users should use the associated > ? # DLL instead of msvcrt directly, if possible. > ? if CONFIG[''host_os''].split(''_'')[1] > ? ? ?if CONFIG[''host_os''].split(''_'')[1].to_i >= 80 && > ? ? ? ? File.exists?(File.join(CONFIG[''bindir''], ''ruby.exe.manifest'')) > ? ? ?then > ? ? ? ? MSVCRT_DLL = ''msvcr'' + CONFIG[''host_os''].split(''_'')[1] > ? ? ?else > ? ? ? ? MSVCRT_DLL = ''msvcrt'' > ? ? ?end > ? else > ? ? ?MSVCRT_DLL = ''msvcrt'' > ? end >Did you install ruby binary and Microsoft Visual C++ 8 on the same computer? If not, Microsoft.VC90.CRT.manifest and msvcr90.dll must exist on the ruby bin folder. Regards, Park Heesob
Daniel Berger
2009-Jun-25 04:11 UTC
[Win32utils-devel] Possible problem with msvcrt vs msvcrXX
> -----Original Message----- > From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils-devel- > bounces at rubyforge.org] On Behalf Of Heesob Park > Sent: Wednesday, June 24, 2009 9:20 PM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] Possible problem with msvcrt vs msvcrXX > > Hi, > > 2009/6/25 Daniel Berger <djberg96 at gmail.com>: > > > > > >> -----Original Message----- > >> From: win32utils-devel-bounces at rubyforge.org [mailto:win32utils- > devel- > >> bounces at rubyforge.org] On Behalf Of Heesob Park > >> Sent: Wednesday, June 24, 2009 7:28 PM > >> To: Development and ideas for win32utils projects > >> Subject: Re: [Win32utils-devel] Possible problem with msvcrt vs > msvcrXX > >> > >> Hi, > >> > >> 2009/6/25 Daniel Berger <djberg96 at gmail.com>: > >> > Hi, > >> > > >> > I tried this with a version of Ruby I built with VC++ 2008: > >> > > >> > irb(main):005:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcrt'') > >> > => #<Win32::API:0x4774684> > >> > > >> > irb(main):006:0> strlen = API.new(''strlen'', ''P'', ''L'', ''msvcr90'') > >> > Win32::API::LoadLibraryError: LoadLibrary() function failed for > >> ''msvcr90'': > >> > The specified module could not be found. > >> > from (irb):6:in `initialize'' > >> > from (irb):6:in `new'' > >> > from (irb):6 > >> > > >> > Do I have an environment issue? Do we need to revisit windows-api > >> with > >> > regards to how it sets MSVCRT_DLL? > >> > > >> I remember I saw almost same issue a few years ago :) > >> > >> MSVCR90.dll is not installed in system32, but in the side-by-side > >> folder, hence the manifest is required. > >> > >> Create ''ruby.exe.manifest'' in the ruby''s bin folder like this: > >> mt -inputresource:ruby.exe;2 -out:ruby.exe.manifest > > > > The ruby.exe.manifest *does* exist. I checked. It''s also checked in > the windows-api code: > > > > # With Microsoft Visual C++ 8 and later users should use the > associated > > # DLL instead of msvcrt directly, if possible. > > if CONFIG[''host_os''].split(''_'')[1] > > if CONFIG[''host_os''].split(''_'')[1].to_i >= 80 && > > File.exists?(File.join(CONFIG[''bindir''], > ''ruby.exe.manifest'')) > > then > > MSVCRT_DLL = ''msvcr'' + CONFIG[''host_os''].split(''_'')[1] > > else > > MSVCRT_DLL = ''msvcrt'' > > end > > else > > MSVCRT_DLL = ''msvcrt'' > > end > > > Did you install ruby binary and Microsoft Visual C++ 8 on the same > computer?Yes.> If not, Microsoft.VC90.CRT.manifest and msvcr90.dll must exist on the > ruby bin folder.I must have a path issue. Regards, Dan
Heesob Park
2009-Jun-25 04:45 UTC
[Win32utils-devel] Possible problem with msvcrt vs msvcrXX
2009/6/25 Daniel Berger <djberg96 at gmail.com>:> >> > The ruby.exe.manifest *does* exist. I checked. It''s also checked in >> the windows-api code: >> > >> > ? # With Microsoft Visual C++ 8 and later users should use the >> associated >> > ? # DLL instead of msvcrt directly, if possible. >> > ? if CONFIG[''host_os''].split(''_'')[1] >> > ? ? ?if CONFIG[''host_os''].split(''_'')[1].to_i >= 80 && >> > ? ? ? ? File.exists?(File.join(CONFIG[''bindir''], >> ''ruby.exe.manifest'')) >> > ? ? ?then >> > ? ? ? ? MSVCRT_DLL = ''msvcr'' + CONFIG[''host_os''].split(''_'')[1] >> > ? ? ?else >> > ? ? ? ? MSVCRT_DLL = ''msvcrt'' >> > ? ? ?end >> > ? else >> > ? ? ?MSVCRT_DLL = ''msvcrt'' >> > ? end >> > >> Did you install ruby binary and Microsoft Visual C++ 8 on the same >> computer? > > Yes. > >> If not, Microsoft.VC90.CRT.manifest and msvcr90.dll must exist on the >> ruby bin folder. > > I must have a path issue. >That''s odd. Did you build ruby with non default compiler option? Both ruby.exe and msvcr90-ruby18.dll have dependency with msvcr90.dll. You can check with "dumpbin /imports ruby.exe" If you have a path issue, ruby.exe and irb should failed to run. Regards, Park Heesob