Zach Dennis
12/2/2003 5:42:00 AM
Thanks for the reply Eric. I checked the defines.h file and it has the line
in it that you suggested. I tried to manually add them to my .c file, but
still no go. Anymore ideas? Here is what I have tried from the command line:
cl out.c
cl out.c -IC:\source\ruby-1.8.1
cl out.c -IC:\source\ruby-1.8.1 /link /INCLUDE:C:\ruby\bin
cl out.c -IC:\source\ruby-1.8.1 /link /INCLUDE:C:\ruby\lib
cl out.c -IC:\source\ruby-1.8.1 /link /INCLUDE:C:\source\ruby-1.8.1
Each one of the above is giving me the exact same error as before. I've
tried on Windows 2000 and WinXP.
Zach
-----Original Message-----
From: Eric Sunshine [mailto:sunshine@sunshineco.com]
Sent: Tuesday, December 02, 2003 12:10 AM
To: ruby-talk ML
Subject: Re: Embedding Ruby in C
On Tue, 2 Dec 2003 13:15:23 +0900, Zach Dennis wrote:
> out.obj : error LNK2001: unresolved external symbol _ruby_init
> out.obj : error LNK2001: unresolved external symbol _ruby_finalize
> out.obj : error LNK2001: unresolved external symbol _rb_eval_string
Assuming that you are correctly linking against the ruby library, you also
need to ensure that the RUBY_EXTERN macro (1.8.x) is defined properly (or
the
EXTERN macro for ruby 1.6.x). Look inside Ruby's define.h file to see if
this macro is being defined properly for your situation. If it is not, then
you may have to ensure manually that it is defined in an appropriate manner.
For instance, you are using Windows, so:
#define RUBY_EXTERN extern __declspec(dllimport)
#include <ruby.h>
-- ES