Bug #36947 Error occured on compiling udf_sample.dll on Windows.
Submitted: 26 May 2008 7:20 Modified: 26 May 2008 7:20
Reporter: Meiji KIMURA Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: User-defined functions ( UDF ) Severity:S3 (Non-critical)
Version:5.0.58 OS:Microsoft Windows (with Visual Studio 2005)
Assigned to: CPU Architecture:Any

[26 May 2008 7:20] Meiji KIMURA
I tried to make udf_sample.dll on windows. I saw this link. Compiling and Installing User-Defined Functions

I use the japanese Windows XP SP3 with japanese Visual Studio 2005 SP1.

In procedure 6, I tried to compile (& link) udf_sample.dll using this command.

devenv udf_example.sln /build Release

I got the error in japanese. It means 'stpcpy' function is undefined. Following 2-error(C2113) were caused by the error.

.¥udf_example.c(639) : warning C4013: 関数 'stpcpy' は定義されていません。in
.¥udf_example.c(775) : error C2113: '-' : ポインタ以外からポインタを減算する
.¥udf_example.c(878) : error C2113: '-' : ポインタ以外からポインタを減算する
ビルドログは "file://d:¥VS2005¥udf_example¥udf_example.dir¥Release¥BuildLog
udf_example - エラー 2、警告 1
------ ビルドのスキップ: プロジェクト: ALL_BUILD, 構成: Release Win32 -----
========== ビルド: 0 正常終了、1 失敗、1 更新、1 スキップ ==========

How to repeat:
See Description.

Suggested fix:
In ordinary MS Windows environment, there is no 'stpcpy'. Then modify udf_sample.c source code to not using 'stpcpy'.

Or Add 'stpcpy' only when using MS Windows platform like this,

static char *stpcpy(char *dest, const char *src){strcpy(dest,src);return dest + strlen(dest);}

My workaround is that above static function definition add on line.143.