Hi everyone, What are the odds of getting FFI to build with MSVC++ ? Could it be made to work? Happy New Year! Dan
It is possible, there was a bash wrapper that mapped gcc command line to cl.exe. Sorry for top posting. Sent from mobile. On Dec 31, 2011 1:12 PM, "Daniel Berger" <djberg96 at gmail.com> wrote:> Hi everyone, > > What are the odds of getting FFI to build with MSVC++ ? Could it be made to > work? > > Happy New Year! > > Dan > > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20111231/30fedc77/attachment.html>
Hi, 2012/1/1 Luis Lavena <luislavena at gmail.com>> It is possible, there was a bash wrapper that mapped gcc command line to > cl.exe. > > Sorry for top posting. Sent from mobile. > On Dec 31, 2011 1:12 PM, "Daniel Berger" <djberg96 at gmail.com> wrote: > >> Hi everyone, >> >> What are the odds of getting FFI to build with MSVC++ ? Could it be made >> to >> work? >> >> Happy New Year! >> >> Dan >> >> >>I managed to compile and make ffi_c.so with Visual Studio 2010 Express and Ruby 2.0.0dev. I can build libffi library easily using the wrapper msvcc.sh. But, I have to edit source codes and Makefile of ext/ffi_c manulally for the incompatibility of cl.exe and nmake.exe with gcc. The changes of source codes are mainly like this: #ifndef _MSC_VER #include <sys/param.h> #endif #ifndef _MSC_VER #include <stdbool.h> #else typedef int bool; #define true 1 #define false 0 #endif Happy New Year & Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20120102/5eed82f0/attachment.html>
Hi. <snip>> I managed to compile and make ffi_c.so with Visual Studio 2010 Express > and Ruby 2.0.0dev. > I can build libffi library easily using the wrapper msvcc.sh. > But, I have to edit source codes and Makefile of ext/ffi_c manulally > for the incompatibility of cl.exe and nmake.exe with gcc. > > The changes of source codes are mainly like this: > > #ifndef _MSC_VER > #include <sys/param.h> > #endif > #ifndef _MSC_VER > #include <stdbool.h> > #else > typedef int bool; > #define true 1 > #define false 0 > #endifExcellent! Is it possible to build with Ruby 1.8.x or 1.9.x as well? Also, is it possible to patch the source in a way that it would "just work" based on the build type (mingw vs mswin32). If so, please submit a patch to Wayne. If not, perhaps Wayne could be convinced to add a branch to the ffi project. Or perhaps a fork is in order. What do you think? Regards, Dan
Hi, 2012/1/3 Daniel Berger <djberg96 at gmail.com>> Hi. > > <snip> > > > I managed to compile and make ffi_c.so with Visual Studio 2010 Express > > and Ruby 2.0.0dev. > > I can build libffi library easily using the wrapper msvcc.sh. > > But, I have to edit source codes and Makefile of ext/ffi_c manulally > > for the incompatibility of cl.exe and nmake.exe with gcc. > > > > The changes of source codes are mainly like this: > > > > #ifndef _MSC_VER > > #include <sys/param.h> > > #endif > > #ifndef _MSC_VER > > #include <stdbool.h> > > #else > > typedef int bool; > > #define true 1 > > #define false 0 > > #endif > > Excellent! > > Is it possible to build with Ruby 1.8.x or 1.9.x as well? > >I succeeded in building with Ruby 1.8.7-p352 and Ruby 1.9.3-p0 as well.> Also, is it possible to patch the source in a way that it would "just > work" based on the build type (mingw vs mswin32). If so, please submit a > patch to Wayne. If not, perhaps Wayne could be convinced to add a branch to > the ffi project. Or perhaps a fork is in order. > >That is technically possible, but it is a time-consuming and cumbersome process. Is there anybody willing to make a patch? If not I''ll make it until the end of this month. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20120103/775cfa0d/attachment-0001.html>
Hi, 2012/1/3 Heesob Park <phasis at gmail.com>> Hi, > > 2012/1/3 Daniel Berger <djberg96 at gmail.com> > >> Hi. >> >> <snip> >> >> > I managed to compile and make ffi_c.so with Visual Studio 2010 Express >> > and Ruby 2.0.0dev. >> > I can build libffi library easily using the wrapper msvcc.sh. >> > But, I have to edit source codes and Makefile of ext/ffi_c manulally >> > for the incompatibility of cl.exe and nmake.exe with gcc. >> > >> > The changes of source codes are mainly like this: >> > >> > #ifndef _MSC_VER >> > #include <sys/param.h> >> > #endif >> > #ifndef _MSC_VER >> > #include <stdbool.h> >> > #else >> > typedef int bool; >> > #define true 1 >> > #define false 0 >> > #endif >> >> Excellent! >> >> Is it possible to build with Ruby 1.8.x or 1.9.x as well? >> >> > I succeeded in building with Ruby 1.8.7-p352 and Ruby 1.9.3-p0 as well. > > >> Also, is it possible to patch the source in a way that it would "just >> work" based on the build type (mingw vs mswin32). If so, please submit a >> patch to Wayne. If not, perhaps Wayne could be convinced to add a branch to >> the ffi project. Or perhaps a fork is in order. >> >> > That is technically possible, but it is a time-consuming and cumbersome > process. > Is there anybody willing to make a patch? > If not I''ll make it until the end of this month. > >I forked ffi and made "just work" version of mingw and mswin32. You can download it from https://github.com/phasis68/ffi Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20120109/c695486e/attachment.html>
Hi,> I forked ffi and made "just work" version of mingw and mswin32. > > You can download it from https://github.com/phasis68/ffiFantastic! I cloned the repo locally and tried to install it using "rake gem:install". BTW, that takes a few minutes and requires the rake-compiler and rdoc gems for anyone else who wants to try it. Anyway, it eventually failed with: AbstractMemory.c AbstractMemory.c(34) : fatal error C1083: Cannot open include file: ''stdint.h'': No such file or directory NMAKE : fatal error U1077: ''"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"'' : re turn code ''0x2'' Stop. This is with MSVC++ 9 on Windows Vista. Here''s some more detail ... mkdir -p pkg cd pkg/ffi-1.0.11 Successfully built RubyGem Name: ffi Version: 1.0.11 File: ffi-1.0.11.gem mv ffi-1.0.11.gem ../ffi-1.0.11.gem cd - gem.bat install --local pkg/ffi-1.0.11 Building native extensions. This could take a while... ERROR: Error installing pkg/ffi-1.0.11: ERROR: Failed to build gem native extension. c:/rubyvc9/bin/ruby.exe extconf.rb checking for rb_thread_blocking_region()... no checking for ruby_thread_has_gvl_p()... no checking for ruby_native_thread_p()... no checking for rb_thread_call_with_gvl()... no creating extconf.h creating Makefile nmake Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved. c:\rubyvc9\bin\ruby -e "puts ''EXPORTS'', ''Init_ffi_c''" > ffi_c-i386-mswin32_90.def Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved. 1 file(s) copied. 1 file(s) copied. cl.exe -EP -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS -D_WINNT -D_WIN32_WINNT =0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I .\include -I .\src\x86 .\src \x86\win32.S >.\src\x86\win32.asm win32.S cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS -D_WINNT -D_WIN32_WINNT0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I .\include -I .\src\x86 -Fo.\s rc\closures.obj -Fd.\.libs\ffi-3-src .\src\closures.c closures.c cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS -D_WINNT -D_WIN32_WINNT0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I .\include -I .\src\x86 -Fo.\s rc\debug.obj -Fd.\.libs\ffi-3-src .\src\debug.c debug.c cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS -D_WINNT -D_WIN32_WINNT0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I .\include -I .\src\x86 -Fo.\s rc\java_raw_api.obj -Fd.\.libs\ffi-3-src .\src\java_raw_api.c java_raw_api.c cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS -D_WINNT -D_WIN32_WINNT0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I .\include -I .\src\x86 -Fo.\s rc\prep_cif.obj -Fd.\.libs\ffi-3-src .\src\prep_cif.c prep_cif.c cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS -D_WINNT -D_WIN32_WINNT0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I .\include -I .\src\x86 -Fo.\s rc\raw_api.obj -Fd.\.libs\ffi-3-src .\src\raw_api.c raw_api.c cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS -D_WINNT -D_WIN32_WINNT0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I .\include -I .\src\x86 -Fo.\s rc\types.obj -Fd.\.libs\ffi-3-src .\src\types.c types.c cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS -D_WINNT -D_WIN32_WINNT0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I .\include -I .\src\x86 -Fo.\s rc\x86\ffi.obj -Fd.\.libs\ffi-3-src .\src\x86\ffi.c ffi.c ml.exe -c -coff -W3 -Cx -Zm -Di386 -DQUIET -D?QUIET /Fo .\src\x86\win32.obj .\src\x86\win32. asm Assembling: .\src\x86\win32.asm .\src\x86\win32.asm(842) : warning A6004:procedure argument or local not referenced : FORCEFRAME .\src\x86\win32.asm(995) : warning A6004:procedure argument or local not referenced : FORCEFRAME Microsoft (R) Macro Assembler Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved. "link.exe" /LIB /NOLOGO /MACHINE:X86 /out:.\.libs\libffi_convenience.lib @C:\Users\djberge\A ppData\Local\Temp\nm5C70.tmp cl -W3 -nologo -I. -I. -Ic:/rubyvc9/lib/ruby/1.8/i386-mswin32_90 -I. -Ic:\rubyvc9\lib\ruby\g ems\1.8\gems\ffi-1.0.11\ext\ffi_c/libffi/include -Ic:\rubyvc9\lib\ruby\gems\1.8\gems\ffi-1.0.11\ext\ ffi_c/libffi/src/x86 -MD -O2b2xty- -DRUBY_EXTCONF_H=\"extconf.h\" -D_CRT_SECURE_NO_DEPRECATE -D_CR T_NONSTDC_NO_DEPRECATE -c -TcAbstractMemory.c AbstractMemory.c AbstractMemory.c(34) : fatal error C1083: Cannot open include file: ''stdint.h'': No such file or dire ctory NMAKE : fatal error U1077: ''"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"'' : re turn code ''0x2'' Stop. Gem files will remain installed in c:/rubyvc9/lib/ruby/gems/1.8/gems/ffi-1.0.11 for inspection. Results logged to c:/rubyvc9/lib/ruby/gems/1.8/gems/ffi-1.0.11/ext/ffi_c/gem_make.out rake aborted! Command failed with status (1): [ gem.bat install --local pkg/ffi-1.0.11...] Tasks: TOP => gem:install (See full trace by running task with --trace) What have I done wrong? Regards, Dan
Hi, 2012/1/9 Daniel Berger <djberg96 at gmail.com>> Hi, > > > I forked ffi and made "just work" version of mingw and mswin32. > > > > You can download it from https://github.com/phasis68/ffi > > Fantastic! > > I cloned the repo locally and tried to install it using "rake > gem:install". BTW, that takes a few minutes and requires the rake-compiler > and rdoc gems for anyone else who wants to try it. > > Anyway, it eventually failed with: > > AbstractMemory.c > AbstractMemory.c(34) : fatal error C1083: Cannot open include file: > ''stdint.h'': No such file or directory > NMAKE : fatal error U1077: ''"c:\Program Files (x86)\Microsoft Visual > Studio 9.0\VC\BIN\cl.EXE"'' : re > turn code ''0x2'' > Stop. > > This is with MSVC++ 9 on Windows Vista. > > Here''s some more detail > > ... > mkdir -p pkg > cd pkg/ffi-1.0.11 > Successfully built RubyGem > Name: ffi > Version: 1.0.11 > File: ffi-1.0.11.gem > mv ffi-1.0.11.gem ../ffi-1.0.11.gem > cd - > gem.bat install --local pkg/ffi-1.0.11 > Building native extensions. This could take a while... > ERROR: Error installing pkg/ffi-1.0.11: > ERROR: Failed to build gem native extension. > > c:/rubyvc9/bin/ruby.exe extconf.rb > checking for rb_thread_blocking_region()... no > checking for ruby_thread_has_gvl_p()... no > checking for ruby_native_thread_p()... no > checking for rb_thread_call_with_gvl()... no > creating extconf.h > creating Makefile > > nmake > > Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 > Copyright (C) Microsoft Corporation. All rights reserved. > > c:\rubyvc9\bin\ruby -e "puts ''EXPORTS'', ''Init_ffi_c''" > > ffi_c-i386-mswin32_90.def > > Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 > Copyright (C) Microsoft Corporation. All rights reserved. > > 1 file(s) copied. > 1 file(s) copied. > cl.exe -EP -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 > -D_WINDOWS -D_WINNT -D_WIN32_WINNT > =0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I > .\include -I .\src\x86 .\src > \x86\win32.S >.\src\x86\win32.asm > win32.S > cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS > -D_WINNT -D_WIN32_WINNT> 0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I > .\include -I .\src\x86 -Fo.\s > rc\closures.obj -Fd.\.libs\ffi-3-src .\src\closures.c > closures.c > cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS > -D_WINNT -D_WIN32_WINNT> 0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I > .\include -I .\src\x86 -Fo.\s > rc\debug.obj -Fd.\.libs\ffi-3-src .\src\debug.c > debug.c > cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS > -D_WINNT -D_WIN32_WINNT> 0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I > .\include -I .\src\x86 -Fo.\s > rc\java_raw_api.obj -Fd.\.libs\ffi-3-src .\src\java_raw_api.c > java_raw_api.c > cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS > -D_WINNT -D_WIN32_WINNT> 0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I > .\include -I .\src\x86 -Fo.\s > rc\prep_cif.obj -Fd.\.libs\ffi-3-src .\src\prep_cif.c > prep_cif.c > cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS > -D_WINNT -D_WIN32_WINNT> 0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I > .\include -I .\src\x86 -Fo.\s > rc\raw_api.obj -Fd.\.libs\ffi-3-src .\src\raw_api.c > raw_api.c > cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS > -D_WINNT -D_WIN32_WINNT> 0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I > .\include -I .\src\x86 -Fo.\s > rc\types.obj -Fd.\.libs\ffi-3-src .\src\types.c > types.c > cl.exe -c -nologo -Zi -D_MD -W3 -DWIN32 -DWINNT -D_WIN32 -D_WINDOWS > -D_WINNT -D_WIN32_WINNT> 0x0501 -D_WIN32_IE=0x0600 -D_X86_=1 -DNDEBUG -MD -O2 -Ob2 -Oy- -I . -I > .\include -I .\src\x86 -Fo.\s > rc\x86\ffi.obj -Fd.\.libs\ffi-3-src .\src\x86\ffi.c > ffi.c > ml.exe -c -coff -W3 -Cx -Zm -Di386 -DQUIET -D?QUIET /Fo > .\src\x86\win32.obj .\src\x86\win32. > asm > Assembling: .\src\x86\win32.asm > .\src\x86\win32.asm(842) : warning A6004:procedure argument or local not > referenced : FORCEFRAME > .\src\x86\win32.asm(995) : warning A6004:procedure argument or local not > referenced : FORCEFRAME > Microsoft (R) Macro Assembler Version 9.00.21022.08 > Copyright (C) Microsoft Corporation. All rights reserved. > > "link.exe" /LIB /NOLOGO /MACHINE:X86 > /out:.\.libs\libffi_convenience.lib @C:\Users\djberge\A > ppData\Local\Temp\nm5C70.tmp > cl -W3 -nologo -I. -I. -Ic:/rubyvc9/lib/ruby/1.8/i386-mswin32_90 > -I. -Ic:\rubyvc9\lib\ruby\g > ems\1.8\gems\ffi-1.0.11\ext\ffi_c/libffi/include > -Ic:\rubyvc9\lib\ruby\gems\1.8\gems\ffi-1.0.11\ext\ > ffi_c/libffi/src/x86 -MD -O2b2xty- -DRUBY_EXTCONF_H=\"extconf.h\" > -D_CRT_SECURE_NO_DEPRECATE -D_CR > T_NONSTDC_NO_DEPRECATE -c -TcAbstractMemory.c > AbstractMemory.c > AbstractMemory.c(34) : fatal error C1083: Cannot open include file: > ''stdint.h'': No such file or dire > ctory > NMAKE : fatal error U1077: ''"c:\Program Files (x86)\Microsoft Visual > Studio 9.0\VC\BIN\cl.EXE"'' : re > turn code ''0x2'' > Stop. > > > Gem files will remain installed in > c:/rubyvc9/lib/ruby/gems/1.8/gems/ffi-1.0.11 for inspection. > Results logged to > c:/rubyvc9/lib/ruby/gems/1.8/gems/ffi-1.0.11/ext/ffi_c/gem_make.out > rake aborted! > Command failed with status (1): [ gem.bat install --local > pkg/ffi-1.0.11...] > > Tasks: TOP => gem:install > (See full trace by running task with --trace) > > What have I done wrong? > >My test compiler is MSVC++ 10 and it has stdint.h It seems MSVC++ 9 don''t have stdint.h Could you try replacing #if defined(_MSC_VER) && !defined(INT8_MIN) # include <stdint.h> #endif to #if (_MSC_VER >= 16) && !defined(INT8_MIN) # include <stdint.h> #endif ? BTW, I commited some msvc 64bit fixes just a minute ago. Now, ffi works 32bit and 64bit of msvc. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20120110/66a97118/attachment-0001.html>
Hi,> My test compiler is?MSVC++ 10 and it has stdint.h > It seems MSVC++ 9 don''t have stdint.h > > Could you try replacing > > #if defined(_MSC_VER) && !defined(INT8_MIN) > # ?include <stdint.h> > #endif > > to > > #if (_MSC_VER >= 16) && !defined(INT8_MIN) > # ?include <stdint.h> > #endif > ?I suspect you meant 1600. I tried that but then it leads to other errors because it doesn''t understand some of the data types. I think the lack of stdint.h in MSVC 9 is considered a bug by many. I think the best thing to do is to put stdint.h directly into your ffi repo, and use that file if _MSV_VER < 1600. Just copy the one out of MSVC 10.> BTW, I commited some msvc 64bit fixes just a minute ago. > Now, ffi works 32bit and 64bit of msvc.Excellent! Dan
Hi, 2012/1/10 Daniel Berger <djberg96 at gmail.com>> Hi, > > > My test compiler is MSVC++ 10 and it has stdint.h > > It seems MSVC++ 9 don''t have stdint.h > > > > Could you try replacing > > > > #if defined(_MSC_VER) && !defined(INT8_MIN) > > # include <stdint.h> > > #endif > > > > to > > > > #if (_MSC_VER >= 16) && !defined(INT8_MIN) > > # include <stdint.h> > > #endif > > ? > > I suspect you meant 1600. I tried that but then it leads to other > errors because it doesn''t understand some of the data types. I think > the lack of stdint.h in MSVC 9 is considered a bug by many. > > Yes, you are right.> I think the best thing to do is to put stdint.h directly into your ffi > repo, and use that file if _MSV_VER < 1600. Just copy the one out of > MSVC 10. > >OK, I just copied the stdint.h out of MSVC 10. And I confirmd it''s working on MSVC 9 compiled ruby 1.8.7 and 1.9.3. Regards, Park Heesob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20120110/d83f9ddf/attachment.html>
On Mon, Jan 9, 2012 at 8:52 PM, Heesob Park <phasis at gmail.com> wrote:> Hi, > > 2012/1/10 Daniel Berger <djberg96 at gmail.com> >> >> Hi, >> >> > My test compiler is?MSVC++ 10 and it has stdint.h >> > It seems MSVC++ 9 don''t have stdint.h >> > >> > Could you try replacing >> > >> > #if defined(_MSC_VER) && !defined(INT8_MIN) >> > # ?include <stdint.h> >> > #endif >> > >> > to >> > >> > #if (_MSC_VER >= 16) && !defined(INT8_MIN) >> > # ?include <stdint.h> >> > #endif >> > ? >> >> I suspect you meant 1600. I tried that but then it leads to other >> errors because it doesn''t understand some of the data types. I think >> the lack of stdint.h in MSVC 9 is considered a bug by many. >> > Yes, you are right. > >> >> I think the best thing to do is to put stdint.h directly into your ffi >> repo, and use that file if _MSV_VER < 1600. Just copy the one out of >> MSVC 10. >> > > OK, I just copied the stdint.h out of MSVC 10. > And I confirmd it''s working on MSVC 9 compiled ruby 1.8.7 and 1.9.3.Great! How are you installing it locally? I can''t seem to use the rake task because it demands rdoc, and rdoc is demanding iconv, which doesn''t appear to support MSVC++ / nmake. I tried running ruby extconf.rb + nmake + nmake install, but that doesn''t appear to be the right way to do things. Thanks, Dan
Hi, 2012/1/10 Daniel Berger <djberg96 at gmail.com>:> On Mon, Jan 9, 2012 at 8:52 PM, Heesob Park <phasis at gmail.com> wrote: >> Hi, >> >> 2012/1/10 Daniel Berger <djberg96 at gmail.com> >>> >>> Hi, >>> >>> > My test compiler is?MSVC++ 10 and it has stdint.h >>> > It seems MSVC++ 9 don''t have stdint.h >>> > >>> > Could you try replacing >>> > >>> > #if defined(_MSC_VER) && !defined(INT8_MIN) >>> > # ?include <stdint.h> >>> > #endif >>> > >>> > to >>> > >>> > #if (_MSC_VER >= 16) && !defined(INT8_MIN) >>> > # ?include <stdint.h> >>> > #endif >>> > ? >>> >>> I suspect you meant 1600. I tried that but then it leads to other >>> errors because it doesn''t understand some of the data types. I think >>> the lack of stdint.h in MSVC 9 is considered a bug by many. >>> >> Yes, you are right. >> >>> >>> I think the best thing to do is to put stdint.h directly into your ffi >>> repo, and use that file if _MSV_VER < 1600. Just copy the one out of >>> MSVC 10. >>> >> >> OK, I just copied the stdint.h out of MSVC 10. >> And I confirmd it''s working on MSVC 9 compiled ruby 1.8.7 and 1.9.3. > > Great! > > How are you installing it locally? I can''t seem to use the rake task > because it demands rdoc, and rdoc is demanding iconv, which doesn''t > appear to support MSVC++ / nmake. I tried running ruby extconf.rb + > nmake + nmake install, but that doesn''t appear to be the right way to > do things.Using rake task is the right way. But as you know, rake aborted with rdoc/task failure. The workaround is building gem package by running rake gem:package on Ruby 1.9.3. And running gem install with the generated gem file on Ruby 1.8.7. Of course, Ruby 1.8.7 needs zlib and gem library. Regards, Park Heesob
Hi,> > How are you installing it locally? I can''t seem to use the rake task > > because it demands rdoc, and rdoc is demanding iconv, which doesn''t > > appear to support MSVC++ / nmake. I tried running ruby extconf.rb + > > nmake + nmake install, but that doesn''t appear to be the right way to > > do things. > > Using rake task is the right way. > But as you know, rake aborted with rdoc/task failure. > > The workaround is building gem package by running rake gem:package on > Ruby 1.9.3. > And running gem install with the generated gem file on Ruby 1.8.7. > Of course, Ruby 1.8.7 needs zlib and gem library.Excellent, that worked, thanks! Fantastic work! Regards, Dan