"Cannot export Init_ext: symbol not defined" error when comp

Hello,

I’m trying to follow the instructions to compile a ruby extension on
Linux
for Windows via Mingw.

The tutorial is at http://eigenclass.org/hiki.rb?cross+compiling+rcovrt

So far, I am stuck on the cross-compile.sh step. Here is my error
output:

rbconfig.rb unchanged
i586-mingw32msvc-windres --include-dir . --include-dir . --include-dir
./win32 ruby.rc ruby.res.o
i586-mingw32msvc-windres --include-dir . --include-dir . --include-dir
./win32 msvcrt-ruby18.rc msvcrt-ruby18.res.o
i586-mingw32msvc-gcc -shared -s -Wl,–enable-auto-import,–export-all
-Wl,–out-implib=libmsvcrt-ruby18.dll.a array.o bignum.o class.o
compar.o
dir.o dln.o enum.o error.o eval.o file.o gc.o hash.o inits.o io.o
marshal.o
math.o numeric.o object.o pack.o parse.o process.o prec.o random.o
range.o
re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o
util.o
variable.o version.o fileblocks.o crypt.o flock.o win32.o dmyext.o
msvcrt-ruby18.res.o -lwsock32 -o msvcrt-ruby18.dll
Cannot export Init_ext: symbol not defined
Creating library file: libmsvcrt-ruby18.dll.a
ruby.o: In function require_libraries': /home/btakita/downloads/ruby-1.8.5/ruby.c:348: undefined reference to_Init_ext’
collect2: ld returned 1 exit status
make: *** [msvcrt-ruby18.dll] Error 1

Here is my cross-compile.sh file:

#!/bin/sh
env ac_cv_func_getpgrp_void=no
ac_cv_func_setpgrp_void=yes
rb_cv_negative_time_t=no
ac_cv_func_memcmp_working=yes
rb_cv_binary_elf=no
./configure
–host=i586-mingw32msvc
–target=i386-mingw32
–build=i686-linux
–prefix=/usr/local/ruby-mingw32
make ruby
#make install

In the tutorial, the --prefix option was /where/to/install/ruby-mingw32
I’m not totally sure if what I put in makes sense.

Thank you,
Brian T.

Brian, better use MSVS 2005 for it. Ruby 1.8.5 is compiled in Studio.

Hi,

At Sun, 15 Oct 2006 16:55:54 +0900,
Brian T. wrote in [ruby-talk:219783]:

ruby.o: In function require_libraries': /home/btakita/downloads/ruby-1.8.5/ruby.c:348: undefined reference to_Init_ext’
collect2: ld returned 1 exit status
make: *** [msvcrt-ruby18.dll] Error 1

Init_ext() is defined in dmyext.c. Isn’t dmyext.o corrupt?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs