compiling ruby under windows (+ gtk stuff, is the gtk list dead?)

Discussion in 'Ruby' started by Gergely Kontra, Jun 18, 2004.

  1. Hi!

    I tried to compile ruby under windows with mingw:
    mingw 3.1.0
    msys 1.0.11-20040430

    My iconv.h:
    #define _LIBICONV_VERSION 0x0109 /* version number: (major<<8) +
    minor */

    The error message:
    make[1]: Entering directory `/f/tmp/ruby-1.9/ext/iconv'
    gcc -shared -s -Wl,--enable-auto-import,--export-all -L'../..'
    -L'c:/programs/ruby19/lib' -o ../../.ext/i386-mingw32/iconv.so iconv.o
    -lmsvcrt-ruby19 -lwsock32
    iconv.o(.text+0xf7):iconv.c: undefined reference to
    `_imp__libiconv_open'
    iconv.o(.text+0x133):iconv.c: undefined reference to
    `_imp__libiconv_open'
    iconv.o(.text+0x1e9):iconv.c: undefined reference to
    `_imp__libiconv_close'
    iconv.o(.text+0x21e):iconv.c: undefined reference to
    `_imp__libiconv_close'
    iconv.o(.text+0x30d):iconv.c: undefined reference to `_imp__libiconv'
    make[1]: *** [../../.ext/i386-mingw32/iconv.so] Error 1
    make[1]: Leaving directory `/f/tmp/ruby-1.9/ext/iconv'
    make: *** [all] Error 1

    After deleting the iconv library :)
    C:\programs\ruby19\bin>ruby -v
    ruby 1.9.0 (2004-06-04) [i386-mingw32]

    The same with ruby 1.8.2
    make[1]: Entering directory `/f/tmp/ruby-1.8/ext/iconv'
    gcc -O2 -I. -If:/tmp/ruby-1.8 -If:/tmp/ruby-1.8
    -If:/tmp/ruby-1.8/ext/iconv -DHAVE_ICONV_H -DICONV_INPTR_CAST="" -c
    iconv.c
    gcc -shared -s -Wl,--enable-auto-import,--export-all
    -L'f:/tmp/ruby-1.8' -L'/programs/ruby181/lib' -o iconv.so iconv.o
    -lmsvcrt-ruby18 -lwsock32
    iconv.o(.text+0xe7):iconv.c: undefined reference to
    `_imp__libiconv_open'
    iconv.o(.text+0x123):iconv.c: undefined reference to
    `_imp__libiconv_open'
    iconv.o(.text+0x1a9):iconv.c: undefined reference to
    `_imp__libiconv_close'
    iconv.o(.text+0x1de):iconv.c: undefined reference to
    `_imp__libiconv_close'
    iconv.o(.text+0x2bd):iconv.c: undefined reference to `_imp__libiconv'
    make[1]: *** [iconv.so] Error 1
    make[1]: Leaving directory `/f/tmp/ruby-1.8/ext/iconv'
    make: *** [all] Error 1

    And, libraries go to msys
    Compilation starts with:

    /configure --prefix=c:/programs/ruby18 && make && make install

    I end up with some libs in
    c:/programs/msys1.0.11-20040430/programs/ruby18/lib

    kgergely@LIGHTSPEED
    /c/programs/msys/1.0.11-20040430/programs/ruby18/lib/ruby/1.8
    $ ls
    bigdecimal remote-tk.rb tkcanvas.rb tkmacpkg.rb tkvirtevent.rb
    dl sha1.rb tkclass.rb tkmenubar.rb tkwinpkg.rb
    i386-mingw32 tk tkconsole.rb tkmngfocus.rb
    kconv.rb tk.rb tkdialog.rb tkpalette.rb
    md5.rb tkafter.rb tkentry.rb tkscrollbox.rb
    multi-tk.rb tkbgerror.rb tkfont.rb tktext.rb


    ------------------
    gtk2 stuff:

    kgergely@LIGHTSPEED /c/tmp/ruby-gtk2-0.9.1
    $ ruby extconf.rb
    extconf.rb: Entering directory `glib'
    extconf.rb:50:in `system': No such file or directory -
    c:\programs\ruby19\bin\ruby (Errno::ENOENT)
    from extconf.rb:50
    from extconf.rb:42:in `each'
    from extconf.rb:42

    when compiling parts manually:

    kgergely@LIGHTSPEED /c/tmp/ruby-gtk2-0.9.1/atk
    $ make
    make[1]: Entering directory `/c/tmp/ruby-gtk2-0.9.1/atk/src'
    make[1]: *** No rule to make target `ruby.h', needed by `rbatk.o'.
    Stop.
    make[1]: Leaving directory `/c/tmp/ruby-gtk2-0.9.1/atk/src'
    make: *** [all] Error 2

    kgergely@LIGHTSPEED /c/tmp/ruby-gtk2-0.9.1/atk
    $ make
    make[1]: Entering directory `/c/tmp/ruby-gtk2-0.9.1/atk/src'
    make[1]: *** No rule to make target `defines.h', needed by `rbatk.o'.
    Stop.
    make[1]: Leaving directory `/c/tmp/ruby-gtk2-0.9.1/atk/src'
    make: *** [all] Error 2


    kgergely@LIGHTSPEED /f/tmp/ruby-gtk2-0.9.1/gdkpixbuf
    $ ruby extconf.rb
    checking for GCC... yes
    checking for rb_define_alloc_func()... no
    checking for rb_block_proc()... no
    checking for new allocation framework... yes
    checking for attribute assignment... yes
    checking for gdk-pixbuf-2.0... yes
    checking for G_PLATFORM_WIN32... yes
    checking for G_OS_WIN32... yes
    checking for g_print()... no

    Gergõ
    --
    +-[ Kontra, Gergely<> PhD student Room IB113 ]---------+
    | http://www.mcl.hu/~kgergely "Olyan langesz vagyok, hogy |
    | Mobil:(+36 20) 356 9656 ICQ: 175564914 poroltoval kellene jarnom" |
    +-- Magyar php mirror es magyar php dokumentacio: http://hu.php.net --+
     
    Gergely Kontra, Jun 18, 2004
    #1
    1. Advertising

  2. --- Gergely Kontra <> wrote:
    > Hi!
    >
    > I tried to compile ruby under windows with mingw:
    > mingw 3.1.0
    > msys 1.0.11-20040430


    I don't use msys but I can tell you how I compile mingw32-ruby
    with cygwin:

    export CC=/usr/local/mingw32/bin/gcc.exe
    export LD=/usr/local/mingw32/bin/ld.exe
    export AR=/usr/local/mingw32/bin/ar.exe
    export AS=/usr/local/mingw32/bin/as.exe
    export RANLIB=/usr/local/mingw32/bin/ranlib.exe
    export CPP=/usr/local/mingw32/bin/cpp.exe
    export CXX=/usr/local/mingw32/bin/g++.exe
    export NM=/usr/local/mingw32/bin/nm.exe
    /configure --build=i386-mingw32 --host=i386-mingw32 --target=i386-mingw32

    It may be overkill but it works every time. You can verify ruby
    does not depend on cygwin using cygcheck,

    > cygcheck ./ruby.exe

    /ruby.exe
    .\msvcrt-ruby18.dll
    C:\WINNT\system32\ADVAPI32.DLL
    C:\WINNT\system32\NTDLL.DLL
    C:\WINNT\system32\KERNEL32.DLL
    C:\WINNT\system32\RPCRT4.DLL
    C:\WINNT\system32\msvcrt.dll
    C:\WINNT\system32\USER32.dll
    C:\WINNT\system32\GDI32.DLL
    C:\WINNT\system32\WSOCK32.DLL
    C:\WINNT\system32\WS2_32.DLL
    C:\WINNT\system32\WS2HELP.DLL

    There's also a -no-cygwin flag to gcc, but I've always preferred
    using the latest mingw compiler.

    I'm actually not sure why msys exists; cygwin has been around
    a while and has worked out many of its kinks.

    > kgergely@LIGHTSPEED /c/tmp/ruby-gtk2-0.9.1

    This reminded me of Lightspeed C, the very first C compiler I saw and used :)





    __________________________________
    Do you Yahoo!?
    Take Yahoo! Mail with you! Get it on your mobile phone.
    http://mobile.yahoo.com/maildemo
     
    Jeff Mitchell, Jun 18, 2004
    #2
    1. Advertising

  3. Gergely Kontra

    Joao Pedrosa Guest

    Hi,

    --- Jeff Mitchell <> wrote:
    > --- Gergely Kontra <> wrote:
    > > Hi!
    > >
    > > I tried to compile ruby under windows with mingw:
    > > mingw 3.1.0
    > > msys 1.0.11-20040430

    >
    > I don't use msys but I can tell you how I compile
    > mingw32-ruby
    > with cygwin:


    [snip]

    Masao has a guide on compiling Ruby and, most
    importantly, Ruby-GTK with MinGW:
    http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile_mingw

    I have followed successfully the guide a couple of
    times. Maybe something has changed since I used it a
    couple of months ago, but I believe it's just some
    step missing when following it.

    I even managed to compile other extensions
    successfully with it.

    Cheers,
    Joao



    __________________________________
    Do you Yahoo!?
    Yahoo! Mail - You care about security. So do we.
    http://promotions.yahoo.com/new_mail
     
    Joao Pedrosa, Jun 18, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oliver Bleckmann
    Replies:
    2
    Views:
    366
    Keith Thompson
    Nov 12, 2006
  2. Oliver Bleckmann
    Replies:
    6
    Views:
    474
    ondra.holub
    Nov 13, 2006
  3. Luke Kenneth Casson Leighton
    Replies:
    1
    Views:
    357
    Ross Ridge
    Jan 25, 2009
  4. James Tucker
    Replies:
    0
    Views:
    158
    James Tucker
    May 27, 2007
  5. Alex Shulgin
    Replies:
    1
    Views:
    197
    thefed
    Nov 21, 2007
Loading...

Share This Page