Problems embedding ruby in win32

hello there,

i’m attempting to embed ruby into a win32 application i’m developing,
linking statically to the latest ruby 1.8.0 preview release works fine…

however, when i try to link dynamically, i get this error on the first time
i call rb_define_class:

Embedded: wrong argument type Fixnum (expected Class) (TypeError)
Embedded: [BUG] Segmentation fault
ruby 1.8.0 (2003-03-03) [i386-mswin32]

here is the offending line:

KeyClass = rb_define_class("Key", rb_cObject);

it looks to me like this error indicates my headers are out of date with
what the DLL is expecting somehow (corrupt rb_cObject?)…

is there anything i need do, define some symbol or something, to get the
dynamically linked ruby dll working correctly?

does anybody know what could be causing this error?

cheers all

note: i am using vc++ 7.0, latest ruby 1.8.0 preview 2 release

···

-----Original Message-----
From: ruby-talk-admin@ruby-lang.org
[mailto:ruby-talk-admin@ruby-lang.org]
Sent: Sunday, April 13, 2003 11:54 PM
To: gaffer@gaffer.org
Subject: Welcome to our (ruby-talk ML) You are added automatically

Caution: If you reply this mail, the recipient is mailing list!
post articles ruby-talk@ruby-lang.org
commands ruby-talk-ctl@ruby-lang.org
maintainer ruby-talk-admin@ruby-lang.org

Welcome to our mailing list ruby-talk@ruby-lang.org !

This mail contains the fundamental usage of the mailing list server.

1 How to use this server

Plaese send commands in the mail body not subject to the address
ruby-talk-ctl@ruby-lang.org.

The command syntax is as follows:

# help
help

# help

or
help

Please send the “# help” to the address ruby-talk-ctl@ruby-lang.org for
help and
server functions overview

# help

to get general information on this list

# guide

If you want to make a contact with the mailing list maintainer, please
e-mail to

ruby-talk-admin@ruby-lang.org

ML server exists to decrease routine works by maintainers. Please try
to use server functions as could as possible.

			ruby-talk@ruby-lang.org Maintainer
			ruby-talk-admin@ruby-lang.org

Embedded: wrong argument type Fixnum (expected Class) (TypeError)
Embedded: [BUG] Segmentation fault
ruby 1.8.0 (2003-03-03) [i386-mswin32]

When you compile define "IMPORT" and "NT=1" (something like -DIMPORT and
-DNT=1)

Guy Decoux

Perhaps we should add such compile-issues to

Im not a windows person. I there anyone around who can add it ?

···

On Mon, 14 Apr 2003 00:29:44 +0900, ts wrote:

Embedded: wrong argument type Fixnum (expected Class) (TypeError)
Embedded: [BUG] Segmentation fault
ruby 1.8.0 (2003-03-03) [i386-mswin32]

When you compile define “IMPORT” and “NT=1” (something like -DIMPORT and
-DNT=1)


Simon Strandgaard

adding “#define IMPORT” before including ruby fixed it, thankyou

(no need to def NT, its already defined under vc7)

cheers

···

-----Original Message-----
From: ts [mailto:decoux@moulon.inra.fr]
Sent: Monday, April 14, 2003 12:30 AM
To: ruby-talk ML
Cc: ruby-talk@ruby-lang.org
Subject: Re: problems embedding ruby in win32

Embedded: wrong argument type Fixnum (expected Class) (TypeError)
Embedded: [BUG] Segmentation fault
ruby 1.8.0 (2003-03-03) [i386-mswin32]

When you compile define “IMPORT” and “NT=1” (something like -DIMPORT and
-DNT=1)

Guy Decoux