running mingw32-make (v3.80) i get error:
makefile:145: *** target pattern contains no `%'. Stop.
if i run mingw32-make i get this strings:
makefile:154: warning: overriding commands for target `C:/Program'
makefile:148: warning: ignoring old commands for target `C:/Program'
mingw32-make: *** No rule to make target `"/C/Program', needed by
`Welcomer.o'.
Stop.
don't know what to do. is there any way to fix this? or the way to by
pass this?
--
Posted via http://www.ruby-forum.com/.
not sure if it's the problem or not, but i'd try everything with a directory hierarchy that does not contain
any spaces in any of the directory or filenames.
Yes, that is most likely the problem.
MinGW and MSYS, the tools used to compile should never be installed in
a path with spaces. Neither your code should be in a path with spaces.
Just avoid them
--
Luis Lavena
As i understand, error 2 means "The system cannot find the file
specified".
This command generates two files: "Welcomer.o" and "Welcomer.so". One
more question is "is it normal that make generates .so file? maybe .dll
will be more suitable".
You shouldn't be using mingw32-make, but instead the make that comes
with the DevKit (that is, using the wrapper make.bat)
>
> As i understand, error 2 means "The system cannot find the file
> specified".
>
> This command generates two files: "Welcomer.o" and "Welcomer.so". One
> more question is "is it normal that make generates .so file? maybe .dll
> will be more suitable".
".so" are use to load Ruby extension. While is a DLL, it serves no
purpose outside Ruby world.
--
Luis Lavena
make.bat contains next text:
"@echo off
mingw32-make %*"
that's why i used "mingw32-make"
it is still difficult to understand to me why mkmf generates such wrong
pass with "/C/" in th beginning. there is this rows:
topdir = /C/Ruby19/include/ruby-1.9.1
hdrdir = /C/Ruby19/include/ruby-1.9.1
as i wrote, i fixed this rows and get makefile and ran make. there is
what i have on console:
C:\temp\c2r>make
g++ -I. -IC:/Ruby19/include/ruby-1.9.1/i386-mingw32
-IC:/Ruby19/include/ruby-1.9.1/ruby/backward
-IC:/Ruby19/include/ruby-1.9.1 -I. -O2 -g -Wall -Wno-parentheses
-o welcomer.o -c welcomer.cpp
g++ -shared -s -o welcomer.so welcomer.o -L. -LC:/Ruby19/lib -L.
-Wl,--enable-auto-image-base,--enable-auto-import -lmsvcrt-ruby191
-lshell32 -lws2_32
C:\temp\c2r>irb
irb(main):001:0> require 'welcomer'
LoadError: 127: =х эрщфхэр єърчрээр яЁюЎхфєЁр. - Init_welcomer
C:/temp/c2r/welcomer.so
from (irb):1:in `require'
from (irb):1
from C:/Ruby19/bin/irb:12:in `<main>'
there are "welcomer.cpp" in attachments.
i can't get what i'm doing wrong.
Attachments:
http://www.ruby-forum.com/attachment/4270/welcomer.cpp
so there are two questions left:
1. how to get round mkmf to find cpp files
2. why mkmf generates Makefile with incorrect paths
Dunno where you got that make.bat, this is the original make.bat
content:
@ECHO OFF
SETLOCAL
SET DEVKIT=%~dp0..\devkit
SET PATH=%DEVKIT%\gcc\3.4.5\bin;%DEVKIT%\msys\1.0.11\bin
bash.exe --login -i -c "make %*"
> it is still difficult to understand to me why mkmf generates such wrong
> pass with "/C/" in th beginning. there is this rows:
> topdir = /C/Ruby19/include/ruby-1.9.1
> hdrdir = /C/Ruby19/include/ruby-1.9.1
>
mkmf will generate MSYS paths, used by msys-make, as you can see from
the wrapper make.bat
I recommend you clean your current DevKit installation and verify the
proper batch files are being used.
A second recommendation, unless you're really using C++ (which I doubt
since Ruby extension API is C), please name the files .c instead
--
Luis Lavena