|
From: Myles <smp...@gm...> - 2006-07-14 00:01:04
|
Thanks William!
The INSTALL file in the unzip'd swigwin directory says to run
configure/make/make install. That's where I got that from. I also looked at
the Windows stuff in the manual. The Visual C++ stuff does not apply to me.
So I read the part about MinGW. It doesn't say anything about special
treatment for the swiglib in a MinGW environment. It just says autogen.sh,
configure, make. I really don't think there's anything in the documentation
that would have led me to realize I would have to set SWIG_LIB. The faq says
that if your -swiglib is not correct, you need to make sure your configure
prefix is set correctly. I suppose it's possible that I'm just dense.
Now, moving on. I have an example_wrap.c now. If I keep following the
manual:
$ gcc -c -fpic example.c example_wrap.c -I/usr/local/include
example.c:1: warning: -fpic ignored for target (all code is position
independent)
example_wrap.c:1: warning: -fpic ignored for target (all code is position
independent)
example_wrap.c:792:18: ruby.h: No such file or directory
This seems fixable by adding a -I to the gcc cmd:
gcc -c -I"c:\ruby\lib\ruby\1.8\i386-mswin32" -fpic example.c example_wrap.c
-I/usr/local/include
After some warnings, I get a .o file. And here's where I don't know what to
do next.
$ gcc -l"c:\ruby\lib\msvcrt-ruby18.lib" -shared example.o example_wrap.o -o
example.so
c:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot
find -lc:\ruby\lib\msvcrt-ruby18.lib
collect2: ld returned 1 exit status
That file does indeed exist:
Myles@MYLES_LAP ~/swig_test
$ ls -l "c:\ruby\lib\msvcrt-ruby18.lib"
-rw-r--r-- 1 Myles Administ 180612 Dec 24 2005 c:\ruby\lib\msvcrt-
ruby18.lib
I tried using --library. That doesn't give me a file not found error, but it
also doesn't resolve the symbol lookups:
<lots-o-snip>
example_wrap.o(.text+0x1d5b):example_wrap.c: undefined reference to
`rb_define_module_function'
collect2: ld returned 1 exit status
I feel like I'm close. Can you help me get this linked? Sorry to be asking
what amounts to help running gcc (nothing to do with swig). But maybe this
can help improve the manual for someone else like me that is trying to run
all of this with MinGW/Windows. (Seems like everyone in the world can afford
to buy MSVC++ except me.)
Thanks!
--Myles
On 7/13/06, William S Fulton <ws...@fu...> wrote:
>
> The swigwin package includes a prebuilt swig.exe and this is widely
> documented (see the zipfile comment for install instructions). So you do
> not need to download and install mingw/msys to build swig. Everthing
> will just work if you modify your path to point to swig.exe in the
> unzipped directory.
>
> However, if you are wanting to use mingw/msys and install it in the msys
> world, then you should be aware that the pure Windows builds are
> slightly different to the unix builds. Here, I mean mingw/msys+gcc
> builds or visual studio builds are pure Windows builds, whereas a
> cygwin+gcc build is not. For the pure windows builds, the library is
> expected to be found in a subdirectory (called Lib) under the swig.exe
> location. That is why swig -swiglib reports what you see. However,
> because mingw/msys links against the Microsoft C runtime, it doesn't
> really understand unix install paths (such as
> /usr/local/share/swig/1.3.29), so I don't really know how to get it to
> find the library without maybe some autotool trickery. I'll see what I
> can do for a future version.
>
> Anyway, you can easily fix this by setting the SWIG_LIB environment
> variable to point to the library directory. So this is likely to be, but
> of course depends on where you installed swig:
>
> export SWIG_LIB=c:/msys/1.0/local/share/swig/1.3.29
>
> William
>
> Myles wrote:
> > Bueller? Bueller? I think I need to simplify my question.
> >
> > Depite double checking that the Makefile has the correct definition for
> > SWIG_LIB (/usr/local/share/swig/1.3.29), my Windows/MinGW build of
> > swig.exe reports the wrong swiglib directory.
> >
> > $ swig -swiglib
> > C:\msys\1.0\local\bin\Lib
> >
> > Anybody how this could happen? I even tried a 'make clean' to delete all
> > of the pre-compiled stuff that comes with swigwin, and then re-compiled
> > all. Do I need to crack open the source and just figure it out?
> >
> > Thanks!
> > --Myles
> >
> > On 7/12/06, *Myles* <smp...@gm... <mailto:smp...@gm...>>
> > wrote:
> >
> > Hi swig folk--
> >
> > Well, I'm at wit's end. I tried to do everything as plain vanilla,
> > default, by the book as possible. But I can't get it to work. First,
> > I'd like to talk about the install. Then we can move onto more
> > un-fixable (by me) problems later.
> >
> > I am using a purely default installed minsys and mingw. Defaults all
> > the way.
> >
> > I unzip'd swig into my msys home dir and ./configure;make;make
> > install. Here's what I see:
> >
> > Myles@MYLES_LAP ~/swig_test
> > $ ls
> > example.c example.i example.o example_wrap.c example_wrap.o run
> >
> > Myles@MYLES_LAP ~/swig_test
> > $ swig -ruby example.i
> > (1): Error: Unable to find 'swig.swg'
> > (3): Error: Unable to find 'ruby.swg '
> >
> > Myles@MYLES_LAP ~/swig_test
> > $ swig -swiglib
> > C:\msys\1.0\local\bin\Lib
> >
> > Myles@MYLES_LAP ~/swig_test
> > $ ls -l /usr/local/share/
> > aclocal doc man swig
> >
> > Myles@MYLES_LAP ~/swig_test
> > $ ls -l /usr/local/share/swig/1.3.29
> > total 65
> > drwxr-xr-x 2 Myles Administ 0 Jul 12 22:32 allegrocl
> > -rw-r--r-- 1 Myles Administ 686 Jul 12 22:29 allkw.swg
> > -rw-r--r-- 1 Myles Administ 2311 Jul 12 22:28 attribute.i
> > -rw-r--r-- 1 Myles Administ 2810 Jul 12 22:28 carrays.i
> > -rw-r--r-- 1 Myles Administ 2106 Jul 12 22:28 cdata.i
> > etc...
> >
> > Here are the relevant contents of the Makefile:
> >
> > prefix = /usr/local
> > exec_prefix = ${prefix}
> > srcdir = .
> >
> >
> ##############################################################################
> > # Compiler and system configuration
> >
> ##############################################################################
> >
> >
> > SHELL = /bin/sh
> > SWIG_LIB = ${prefix}/share/swig/1.3.29
> >
> > What could've gone wrong? Like I said, I'm a firm believer in
> > sticking to the defaults (so as to best mimic the developer's setup
> > I hope). I'm surprised I could find no mention on the web of anyone
> > else having these problems. I wonder what's unique about my setup?
> >
> > Thanks so much!!
> > --Myles
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> >
> >
> -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services,
> security?
> > Get stuff done quickly with pre-integrated technology to make your job
> easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Swig-user mailing list
> > Swi...@li...
> > https://lists.sourceforge.net/lists/listinfo/swig-user
>
>
|