1 message in com.mysql.lists.win32problems in create a UDF for windows ...| From | Sent On | Attachments |
|---|---|---|
| Kaiying Yang | 21 May 2004 02:21 |
| Subject: | problems in create a UDF for windows platform![]() |
|---|---|
| From: | Kaiying Yang (k.y...@ntlworld.com) |
| Date: | 05/21/2004 02:21:01 AM |
| List: | com.mysql.lists.win32 |
Hi there!
I have a few problems in creating udf for windows platform, I first tested the
udf_example.cpp, and I can not get the udf loaded into mysql.
I use Borland C++ 5.5.1 for Win32 downloaded from Borland site, Windows 2000
professional, mySql 4.0.17-nt.
First, problem in compilation:
E:\mySql\mysql-4.0.18-win-src\mysql-4.0.18\sql>bcc32 -c -tWM -tWD
-IC:\Borland\BCC55\Include -IC:\Borland\BCC55\LIB
-IE:\mySql\mysql-4.0.18-win-src\mysql-4.0.18\include -IC:\Borland\BCC55\Include
udf_example.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
udf_example.cpp:
Error E2238
E:\Checkfree\mySql\mysql-4.0.18-win-src\mysql-4.0.18\include\config-win.h 105:
Multiple declaration for 'size_t'
Error E2337
E:\Checkfree\mySql\mysql-4.0.18-win-src\mysql-4.0.18\include\m_string.h 224:
Only one of a set of overloaded functions can be "C"
Error E2337
E:\Checkfree\mySql\mysql-4.0.18-win-src\mysql-4.0.18\include\m_string.h 225:
Only one of a set of overloaded functions can be "C"
*** 3 errors in Compile ***
I commented out the lines that cause above problems in config-win.h and
m_string.h, the compilation and link works and produced a dll file:
E:\mySql\mysql-4.0.18-win-src\mysql-4.0.18\sql>ilink32 /Tpd
/LC:\Borland\BCC55\LIB udf_example.obj
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
I then copied the udf_example.dll file to my windows path directory,
c:\mysql\bin, and then start mysql steps:
C:\cfi51>mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 33 to server version: 4.0.17-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE FUNCTION metaphon RETURNS STRING SONAME "udf_example.dll"; ERROR 1126: Can't open shared library 'udf_example.dll' (errno: 0 )
What did I do wrong? I know I used 4.0.18 source on my 4.0.17 mySql, but i'd
think this should not matter in this case. Anybody has done the UDF in windows?
what compiler and settings? any input appreciated!
thanks kaiying




