[groonga-dev,02660] Re: MariaDB 10.0.13バンドル版MroongaをVS2013でビルドすると失敗します

Back to archive index

hiroshi hatake cosmo****@gmail*****
2014年 8月 16日 (土) 19:37:28 JST


畑ケです。

source\storage\connect\tabwmi.cpp

を以下のように変更してビルドしてみました。

---
diff --git a/storage/connect/tabwmi.cpp b/storage/connect/tabwmi.cpp
index e47df02..109ef86 100644
--- a/storage/connect/tabwmi.cpp
+++ b/storage/connect/tabwmi.cpp
@@ -7,6 +7,7 @@
  #endif   // !WIN32
  #include "my_global.h"
  #include <stdio.h>
+#include <algorithm>

  #include "global.h"
  #include "plgdbsem.h"
@@ -200,7 +201,7 @@ PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, 
bool inf
o)
          }  // endif res

        len = (unsigned)SysStringLen(propname);
-      length[0] = max(length[0], len);
+      length[0] = (std::max)(length[0], len);
        } // enfor i

      res = SafeArrayDestroy(prnlist);
---

すると今度は違う箇所でのビルドエラーでやはりVS2013ではビルドが通りません。。
以下そのビルドエラーについてです。

MariaDB-with-Mroonga VS2013 build.txt:
https://dl.dropboxusercontent.com/u/36753409/with-mariadb-10.0.13/build-fix-mroonga-4.04-with-mariadb-10.0.13-vc2013-zip-32.log

念の為、MySQL 5.6.20 や MariaDB 10.0.13でも同じようなエラーが出ていない 
かを見るため、
追ってみました。

いずれも

---
 > mkdir build-vc2013-zip-32
 > cd build-vc2013-zip-32
 > cmake ..\<source path> -G "Visual Studio 12" > config.log
 > cmake --build . --config RelWithDebInfo > build.log
---

してビルドを行ったbuild.txtです。

MySQLとMariaDBもビルドしてみました。
以下それらをビルドしたbuild.txtです。

MySQL 5.6.20 VS2013 build.txt:
https://dl.dropboxusercontent.com/u/36753409/with-mariadb-10.0.13/build-mysql-5.6.20-zip32.log
MariDB 10.0.13 VS2013 build.txt:
https://dl.dropboxusercontent.com/u/36753409/with-mariadb-10.0.13/build-mroonga-4.04-with-mariadb-10.0.13-vc2010-zip-32.log

上記の修正を加えたMariaDB-with-Mroonga,MySQL,MariaDBで\sql\sql_locale.cc 
の69行 目:

67: /***** LOCALE BEGIN ar_AE: Arabic - United Arab Emirates *****/
68: static const char *my_locale_month_names_ar_AE[13] =
69: 
{"يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر", 
NullS };

でエラーになってしまっています。。。

On 2014年08月16日 19:01, Kouhei Sutou wrote:
> 須藤です。
>
> In <53EF2****@gmail*****>
>    "[groonga-dev,02658] MariaDB 10.0.13バンドル版MroongaをVS2013でビルドすると失敗します" on Sat, 16 Aug 2014 18:13:50 +0900,
>    hiroshi hatake <cosmo****@gmail*****> wrote:
>
>> MariaDB 10.0.13バンドル版Mroonga 4.04
>> http://packages.groonga.org/nightly/mariadb-10.0.13-with-mroonga-4.04-for-windows.2014.08.16.zip
>> をVisual Studio 2013 Express for Desktopにてビルドするとビルドに失敗します。
>> Visual Studio 2010 Professionalでは問題なくビルドが完了します。
> ...
>> Visual Studio 2013 zip-32:
> ...
>> https://dl.dropboxusercontent.com/u/36753409/with-mariadb-10.0.13/config-mroonga-4.04-with-mariadb-10.0.13-vc2013-zip-32.log
> これを見る感じだと
>
>    C:\jw\workspace\dmbvc2013\powershell\work\source\storage\connect\tabwmi.cpp(203): error C3861: 'max': 識別子が見つかりませんでした [C:\jw\workspace\dmbvc2013\powershell\work\build-vc2013-zip-32\storage\connect\connect.vcxproj]
>
> が原因ですよね。
> connectというストレージエンジンでビルドエラーが発生しているっ
> てことですよね。
>
> MSDNのmaxの説明
>    http://msdn.microsoft.com/en-us/library/a3xbc7ya.aspx
> を読むと、<algorithm>をincludeするとstd::maxが定義されるよう
> にみえます。
>
>> Requirements
>>    Header: <algorithm>
>>    Namespace: std
> ということで、
>
>    source\storage\connect\tabwmi.cpp
>
>>
>    #include <algorithm>
>
> を追加して、203行目の
>
>    length[0] = max(length[0], len);
>
>>
>    length[0] = (std::max)(length[0], len);
>
> にしてみるのはどうでしょうか!?
> (std::maxを括弧で括っているのはmaxがマクロでも展開されない
> ようにするため。)
>
>
> これでビルドできるようになるとすると、これはconnectストレー
> ジエンジンの問題なので、MariaDBに報告するのがよいのかしら。
>
>




groonga-dev メーリングリストの案内
Back to archive index