From: Eric Sunshine Date: 2003-12-02T20:42:30+09:00 Subject: Re: Embedding Ruby in C On Tue, 2 Dec 2003 14:42:26 +0900, Zach Dennis wrote: > 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. 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. It does not appear that you are linking with the Ruby library. You need to link against the library in order for those symbols to be resolved. You should read the Microsoft documentation to find out how to specify the library on the command-line. (Based upon my reading, I got the impression that you can simply specify the library at the end of the command-line after the other options following /link. You may also need to specify /libpath in order to let the linker know where the library is.) Depending upon which version and which binary distribution of Ruby you are using, the library might be named something like mswin32-ruby18.lib. If you are using the source code distribution of Ruby then make sure that you have actually built the project so that the .lib file exists. At run-time, you may also need to place the Ruby .dll in the same directory as your .exe file, or make sure that your PATH environment variable mentions the directory containing the Ruby .dll. -- ES