Hello,
I am trying to build a STAF extension for ruby (not made by me). It
comes with a very simple extconf.rb file:
require ‘mkmf’
dir_config(‘staf’)
have_library(‘STAF’, ‘STAFRegister’)
create_makefile(“STAFHandle”)
However, no matter how I specify the directory (I’ve tried
-with-staf-dir=c:\STAF, -with-staf-lib=c:\STAF\lib, etc) it gives:
checking for STAFRegister() in STAF.lib… no
creating Makefile
I tried to make anyway, but unsuprisingly, it fails. It gives
“Makefile:126: *** target pattern contains no `%’. Stop.” The offending
line:
{$(topdir)}.cc{}.obj:
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:=/)
I’m running ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32],
whatever version of mkmf that comes with the windows one-click installer
and GNU make 3.79.1.
Thanks!
Lucas L. wrote:
However, no matter how I specify the directory (I’ve tried
-with-staf-dir=c:\STAF, -with-staf-lib=c:\STAF\lib, etc) it gives:
checking for STAFRegister() in STAF.lib… no
creating Makefile
Check the mkmf.log file. It should give you some indication as to why it
couldn’t checking for STAFRegister in STAF.lib failed.
Tim H. wrote:
Check the mkmf.log file. It should give you some indication as to why it
checking for STAFRegister in STAF.lib failed.
Whoops, I knew I’d forget something.
I did try, but I couldn’t make any sense of it. Here it is:
have_library: checking for STAFRegister() in STAF.lib…
-------------------- no
“cl -nologo -Feconftest -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I.
-Ic:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi -O2b2xg- -G6 conftest.c
msvcrt-ruby18-static.lib STAF.lib oldnames.lib user32.lib advapi32.lib
ws2_32.lib -link -libpath:”." -libpath:“c:/ruby/lib”
-stack:0x2000000"
checked program was:
/* begin /
1: #define WIN32_LEAN_AND_MEAN
2: #include <winsock2.h>
3: #include <windows.h>
4:
5: /top/
6: int main() { return 0; }
7: int t() { void ((volatile p)()); p = (void (()()))STAFRegister;
return 0; }
/ end */
“cl -nologo -Feconftest -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I.
-Ic:/ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi -O2b2xg- -G6 conftest.c
msvcrt-ruby18-static.lib STAF.lib oldnames.lib user32.lib advapi32.lib
ws2_32.lib -link -libpath:”." -libpath:“c:/ruby/lib”
-stack:0x2000000"
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { STAFRegister(); return 0; }
/ end */
That doesn’t really tell me anything except it couldn’t find
STAFRegister. Not quite sure what those programs are.
Tim H. wrote:
Check the mkmf.log file. It should give you some indication as to why it
couldn’t checking for STAFRegister in STAF.lib failed.
Er, I mean “as to why checking for STAFRegister in STAF.lib failed.”
Lucas L. wrote:
Tim H. wrote:
Tim H. wrote:
Check the mkmf.log file. It should give you some indication as to why it
couldn’t checking for STAFRegister in STAF.lib failed.
Er, I mean “as to why checking for STAFRegister in STAF.lib failed.”
I posted it above, but I don’t get it. I have no idea why there seems to
be two C files there. Are they what mkmf compiled to check for
STAFRegister??
Yes. This is how mkmf “checks” for things, by compiling and/or linking
very small programs and checking the return code from the compiler or
linker. You have to have some familiarity with the compiler and linker
to be able to understand what’s going on and to interpret the results.
Regrettably I don’t know anything about the Windows compiler and linker.
Your best bet is to contact whoever is responsible for this extension.
Tim H. wrote:
Tim H. wrote:
Check the mkmf.log file. It should give you some indication as to why it
couldn’t checking for STAFRegister in STAF.lib failed.
Er, I mean “as to why checking for STAFRegister in STAF.lib failed.”
I posted it above, but I don’t get it. I have no idea why there seems to
be two C files there. Are they what mkmf compiled to check for
STAFRegister??
Nobuyoshi N. wrote:
–with-staf-dir=…
Whoops. I actually meant --, not -. Still doesn’t work.
This is a makefile for nmake.
The one-click installer is compiled with VC6. You have to
compile ruby with gcc and GNU make by yourself. Once you could
compile the extension, the resulted binary is compatible with
the one-click installer.
Surely I can just use nmake? (I have VC2005).
Hi,
At Fri, 26 Sep 2008 09:36:27 +0900,
Lucas L. wrote in [ruby-talk:316037]:
However, no matter how I specify the directory (I’ve tried
-with-staf-dir=c:\STAF, -with-staf-lib=c:\STAF\lib, etc) it gives:
–with-staf-dir=…
{$(topdir)}.cc{}.obj:
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:=/)
This is a makefile for nmake.
I’m running ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32],
whatever version of mkmf that comes with the windows one-click installer
and GNU make 3.79.1.
The one-click installer is compiled with VC6. You have to
compile ruby with gcc and GNU make by yourself. Once you could
compile the extension, the resulted binary is compatible with
the one-click installer.
Nobuyoshi N. wrote:
Hi,
At Mon, 29 Sep 2008 09:50:27 +0900,
Lucas L. wrote in [ruby-talk:316284]:
The one-click installer is compiled with VC6. You have to
compile ruby with gcc and GNU make by yourself. Once you could
compile the extension, the resulted binary is compatible with
the one-click installer.
Surely I can just use nmake? (I have VC2005).
Since VC2005 is binary incompatible with VC6, so it’s absolutely
impossible.
Not according to a blog post I read the other day. It said you can fake
it by changing the manifest and commenting out the line that checks or
something.
Anyway, not wanting to play with Ruby, I managed to get VC6 and it
compiled, but I got segfaults when using the class. Not much I can do
about that…
Thanks anyway!
Hi,
At Mon, 29 Sep 2008 09:50:27 +0900,
Lucas L. wrote in [ruby-talk:316284]:
The one-click installer is compiled with VC6. You have to
compile ruby with gcc and GNU make by yourself. Once you could
compile the extension, the resulted binary is compatible with
the one-click installer.
Surely I can just use nmake? (I have VC2005).
Since VC2005 is binary incompatible with VC6, so it’s absolutely
impossible.