> I didn't intend to build ruby in msvc quite yet. I am planning to build > everything in msvc later, but for now I just wanted to start making some of > my first changes, which happen to be in ruby-fltk, and I am using msvc > because everything will be using that later and I need to start somewhere. I'm afraid that if you want to build extensions with MSVC you will have to use a version of ruby built with MSVC (or possibly, with a lot of hacking, mingw). > I just included the ruby mswin32 dll in my msvc build instead of building > ruby. Do you think this may be a mistake? Should a cygwin build of Ruby > be expected to open a dll? I got the impression that Ruby would open any > library type from any build. I'd suggest not using MSVC projects, but writing an 'extconf.rb' script and using nmake. For a code highliting editor (with c and ruby highlighting) look at www.scintilla.org. > My ruby.h problems were fixed by looking at config.h and setting compile > flags. Little things were wrong like msvc defaulting to WIN32 when > config.h expected _WIN32. Again this is because of cygwin. You will need __MSVCRT__ and NT defined. > > I am now stuck at the require statement. I put rubyfltk.dll in > C:\cygwin\usr\local\lib\ruby\1.6\i386-cygwin and removed the rubyfltk.so > file. Now when I hit the require statement, I get this error: > > /usr/local/lib/ruby/1.6/Fltk.rb:1:in `require': dlopen: Win32 error 126 - > /usr/local/lib/ruby/1.6/i386-cygwin/rubyfltk.dll (LoadError) This is also because of the cygwin/msvc conflict. > > FYI: The problems I (a newbie) encountered when building ruby-fltk > ------------------------------------------------------------------ > Problem 1: .cc files aren't recognized > > See http://support.microsoft.com/support/kb/articles/Q181/5/06.ASP Rename them to .C. This is a known bug. > > Problem 2: error: not all control paths return a value > > Added "return 0;" to end of many many routines This is wierd. I havent had many at all, but it was some time ago I built with MSVC. If the functions return a type VALUE you should be returning Qnil instead of 0. > > > Problem 3: redefinition of default parameter > don't know > > Problem 4: rb_gc_mark parameter mismatch > > I have no clue what this is. Maybe ruby-fltk 0.3 is not compatible with > ruby 1.6.5? I conditionally changed the source to not include the parameter > in the call. NO! Ruby 1.65 is written partly in 'old style c'. If in doubt make the prototype match the function. > > Problem 5 : MSVCRT redefines > > I added /MD to compile (I can't remember where I found how to do this). Cygwin uses a completely different c library. Lorien