Hello,

I'm the maintainer of Ruby Installer for Windows, which provides a
stable version of Ruby language on Windows using GCC:

http://rubyinstaller.org/

A side project of it is a tool that allows developers on Linux and OSX
to cross compile Ruby C extensions, this tool is called rake-compiler:

http://github.com/luislavena/rake-compiler

I'm right now maintaining the MySQL RubyGem (Ruby's packaging system).
For that gem, I need to cross compile the extension using Linux or
OSX.

Using 5.1.47 noinstall packages from MySQL, I managed to cross compile
with success under OSX 10.5 and 10.6, however, I cannot succeed on
Ubuntu 9.10

This is what I receive during the cross compilation:

i586-mingw32msvc-gcc -shared -s -o mysql_api.so mysql.o -L.
-L/home/luis/.rake-compiler/ruby/ruby-1.8.6-p383/lib
-L/home/luis/src/mysql-gem/vendor/mysql-5.1.47-win32/lib/opt -L.
-Wl,--enable-auto-image-base,--enable-auto-import,--export-all
-lmsvcrt-ruby18 -llibmysql  -lshell32 -lwsock32
Cannot exportLIBMYSQL_NULL_THUNK_DATA: symbol not found
collect2: ld returned 1 exit status

After asking about this on MySQL:

http://bugs.mysql.com/bug.php?id=49934

They marked it as a Feature request instead of a bug (previous
versions succeed in the process).

Anyhow, wanted to use gendef to generate a newer import library using
the DLL and natively on Linux without the need of pexports

I've tried the following (in unpacked lib/opt):

rm libmysql.lib
gendef libmysql.dll
i586-mingw32msvc-dlltool --dllname libmysql.dll --input-def
libmysql.def --output-lib libmysql.a

And I started to receive this as result now:

/home/luis/src/mysql-gem/tmp/i386-mingw32/mysql_api/1.8.6/../../../../ext/mysql_api/mysql.c:1433:
undefined reference to `_mysql_stmt_bind_pa...@8'
/home/luis/src/mysql-gem/tmp/i386-mingw32/mysql_api/1.8.6/../../../../ext/mysql_api/mysql.c:1437:
undefined reference to `_mysql_stmt_exec...@4'
/home/luis/src/mysql-gem/tmp/i386-mingw32/mysql_api/1.8.6/../../../../ext/mysql_api/mysql.c:1441:
undefined reference to `_mysql_stmt_store_res...@4'
/home/luis/src/mysql-gem/tmp/i386-mingw32/mysql_api/1.8.6/../../../../ext/mysql_api/mysql.c:1443:
undefined reference to `_mysql_fetch_fie...@4'
/home/luis/src/mysql-gem/tmp/i386-mingw32/mysql_api/1.8.6/../../../../ext/mysql_api/mysql.c:1487:
undefined reference to `_mysql_stmt_bind_res...@8'

I've tried different combinations with "-a" for gendef to
"--add-underscore" or "-k" to dlltool, all without success.

Any hint? I would need to use pexport and commit a def file into my
repository to workaround this issue?

If the problem is Ubuntu mingw32 package, any suggest about installing
mingw-w64 to target 32bits applications that do not interfere with
Ubuntu?

Thank you in advance for your time.
-- 
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

------------------------------------------------------------------------------

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to