Building BDB for windows

Discussion in 'Ruby' started by derek.hans@gmail.com, Apr 27, 2006.

  1. Guest

    I'm trying to get support for Berkely DB under windows, but I have not
    been able to produce a functional build of the BDB library.

    Compiling with Visual Studio produces a dll, however ruby complains
    that it can't find the "Init_bdb" method when trying to use the dll.
    The Init_bdb function deffinitly exists in the source code.

    Compiling under linux produces working linux binaries; however, when I
    tried cross-compiling using mingw (as described in
    http://eigenclass.org/hiki.rb?cross compiling rcovrt), I wasn't able to
    successfully link against the berkeley db dll.

    Furthermore, I tried using the berkeley db dll directly using Ruby/DL,
    again with no success. Code in this style:

    require 'dl/import'
    module BDB
    extend DL::Importable
    dlload "libdb44.dll"
    extern "int db_create(DB **dbp, DB_ENV *dbenv, u_int32_t flags)"
    end

    fails because db_create cannot be found, while something like this:

    require 'dl'
    bdb = DL.dlopen('libdb44.dll')
    db_create = bdb['db_create', 'IPPI']
    db = nil
    db_create.call(db, nil, 0)

    fails because the dll somehow makes ruby "exit unexpectedly" during
    db_create.call.

    I've run out of ideas how to make it work. Has anyone been successful?
     
    , Apr 27, 2006
    #1
    1. Advertising

  2. Guest

    Following the SWIG instructions, I added NT=1 and "IMPORT" to the
    Preprocessor definitions and set the entry point to Init_bdb. I also
    set the multi-threaded DLL option /MD because /ML does not play nice
    with specifying the entry point.

    I now get the following error:

    ../bdb.dll: 127: The specified procedure could not be found. -
    Init_bdb (LoadEr
    ror)
    ../bdb.dll from
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:2
    1:in `require'
    from ./clean.rb:1
    from
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `re
    quire'
    from basic.rb:2
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29: [BUG]
    Segmentation
    fault
    ruby 1.8.4 (2005-12-24) [i386-mswin32]


    This application has requested the Runtime to terminate it in an
    unusual way.
    Please contact the application's support team for more information.


    The last two lines of the message correspond to the error I am getting
    when trying to access the berkeley dll using Ruby/DL.
     
    , Apr 27, 2006
    #2
    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. Ahn Ki-yung

    ANN: BDB++ 0.99b released

    Ahn Ki-yung, May 6, 2004, in forum: C++
    Replies:
    1
    Views:
    613
    Volker Lukas
    May 6, 2004
  2. Ahn Ki-yung

    ANN: BDB++ 1.0 release

    Ahn Ki-yung, Jan 26, 2005, in forum: C++
    Replies:
    0
    Views:
    329
    Ahn Ki-yung
    Jan 26, 2005
  3. Ahn Ki-yung

    ANN: BDB++ 1.1 release

    Ahn Ki-yung, Apr 5, 2005, in forum: C++
    Replies:
    0
    Views:
    344
    Ahn Ki-yung
    Apr 5, 2005
  4. Emiliano Heyns

    Installer for BDB 4.1.25/BDBXML 1.1.0

    Emiliano Heyns, Oct 9, 2003, in forum: Python
    Replies:
    2
    Views:
    324
    Emiliano
    Oct 16, 2003
  5. david
    Replies:
    13
    Views:
    397
    Luis Lavena
    Mar 7, 2010
Loading...

Share This Page