here instructions how to use udf_example.cc on VC++.

Assuming that the user has VC++ 6.0, the Windows MySQL source and
running a MySQL server with the same version.

- Open the mysqld.dsw workspace.
- Add New project to the workspace
- Project name: udf_example
- Select Win32 Dynamic-Link Library
- Click OK
- Select An Empty DLL project
- Click Finish
- Click OK
- Right click over the new project and select Add Files to Project
- Add \sql\udf_example.cpp
- Type Ctrl+N for to create a new file.
- Select text type
- File name: udf_example.def
- Edit the above file with the below contents:

LIBRARY         UDF_EXAMPLE
DESCRIPTION             'Example Using UDF with VC++'
VERSION         1.0
EXPORTS
         metaphon
         myfunc_double
         myfunc_int
         avgcost

- Right Click the udf_example project and select Settings
- Click the C/C++ tab
- Select General in the Category Combo
- Add the macro HAVE_DLOPEN to the PreProcessor definition
- Select Preprocessor in the Category Combo
- Add the include path to the text box: Additional Include directories
   e.g: ../include
- Click Menu Project/Dependencies and add the strings library
- Press F7 for to build the DLL.

Note: the above instructions should be made for both release/debug version

-----------------Configuration: udf_example - Win32 Debug-----------------
Linking...
   Creating library Debug/udf_example.lib and object Debug/udf_example.exp
udf_example.dll - 0 error(s), 0 warning(s)

- Copy the udf_example.dll to the environment path directory:
   \winnt\system32 for example.

- Start the mysql client and issue:

C:\mysql\bin>mysql
mysql> CREATE FUNCTION metaphon RETURNS STRING SONAME "udf_example.dll";
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE FUNCTION myfunc_double RETURNS REAL SONAME "udf_example.dll";
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "udf_example.dll";
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE AGGREGATE FUNCTION avgcost RETURNS REAL SONAME
 "udf_example.dll"; Query OK, 0 rows affected (0.00 sec)



> -----Original Message-----
> From: Nick Kostirya [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, September 03, 2002 4:37 PM
> To:   [EMAIL PROTECTED]
> Subject:      link under Win32 for udf
> 
>  Hello.
>  It's anew me.
>  And how linking under Win32 with --with-mysqld-ldflags=-rdynamic?
>  I need UDF.
>  Thanks in advance.
>  Nick.
> 
> 
> mysql 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to