Bug #95178 MySql failed to build due to error C2039 and C3861 with MSVC on windows
Submitted: 29 Apr 2019 8:29 Modified: 27 May 2019 9:34
Reporter: Lin Lin Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:branch 8.0 OS:Windows
Assigned to: CPU Architecture:Any

[29 Apr 2019 8:29] Lin Lin
Description:
Description:
We (the Microsoft C++ team) use the MySQL project as part of our "Real world code" tests. MySql failed to build due to error C2039 and C3861 with MSVC on windows.It can be reproduced on latest version.Could you please help take a look at this? Thanks in advance!

failure:
D:\MySQL\src\router\src\http\src\digest.h(127,18): error C2039:  'invalid_argument': is not a member of 'std' [D:\MySQL\build_x64\router\src\http\src\http_auth_backend_lib.vcxproj]
D:\MySQL\src\router\src\http\src\digest.h(127,18): error C2039:       throw std::invalid_argument("type wasn't part of Type"); [D:\MySQL\build_x64\router\src\http\src\http_auth_backend_lib.vcxproj]
D:\MySQL\src\router\src\http\src\digest.h(127,1): error C3861:  'invalid_argument': identifier not found [D:\MySQL\build_x64\router\src\http\src\http_auth_backend_lib.vcxproj]
D:\MySQL\src\router\src\http\src\digest.h(127,1): error C3861:       throw std::invalid_argument("type wasn't part of Type"); [D:\MySQL\build_x64\router\src\http\src\http_auth_backend_lib.vcxproj]
strings.lib(ctype-uca.obj) : error LNK2001: unresolved external symbol "unsigned short * * ja_han_pages" (?ja_han_pages@@3PAPEAGA) [D:\MySQL\build_x64\utilities\zlib_decompress.vcxproj]
strings.lib(ctype-uca.obj) : error LNK2001: unresolved external symbol "int const MIN_JA_HAN_PAGE" (?MIN_JA_HAN_PAGE@@3HB) [D:\MySQL\build_x64\utilities\zlib_decompress.vcxproj]
strings.lib(ctype-uca.obj) : error LNK2001: unresolved external symbol "int const MAX_JA_HAN_PAGE" (?MAX_JA_HAN_PAGE@@3HB) [D:\MySQL\build_x64\utilities\zlib_decompress.vcxproj]

How to repeat:
1.git clone -b 8.0 https://github.com/mysql/mysql-server.git D:\MySQL\src
2.it's rely on boost 1.59,so extract boost_1_59_0.zip to D:\MySQL\
3.mkdir build_x64 && pushd build_x64
4.cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=C:\boost_1_68_0\x64 ..\src
5.msbuild /p:Configuration=Release;Platform=x64 build_x64\MySQL.sln /t:Rebuild /m /p:BuildInParallel=true
[29 Apr 2019 8:31] Lin Lin
log_x64_build

Attachment: log_x64_build.log (application/octet-stream, text), 918.90 KiB.

[29 Apr 2019 11:08] MySQL Verification Team
Thank you for the bug report.
[30 Apr 2019 17:58] Jan Kneschke
Posted by developer:
 
Duplicate of:

Bug#29454252 BUILD FAILURE WITH VISUAL STUDIO 2019
Bug#29329330 UNABLE TO BUILD ON WINDOWS - LINE ENDINGS IN UCA9-DUMP.CC
[8 May 2019 1:47] Lin Lin
Hi,

Thanks for your reply!

Is this bug not fixed yet? We can still reproduce this issue in the latest commit 124c7ab.

Thanks,
Lin
[10 May 2019 4:47] Erlend Dahl
Duplicate of

Bug#94258 UNABLE TO BUILD ON WINDOWS - LINE ENDINGS IN uca9-dump.cc

(fixed in 8.0.17).
[27 May 2019 9:34] Lin Lin
Hi, Thanks for your reply!

We checked the latest commit 124c7ab version is 8.0.16. You said that it has been fixed on 8.0.17. But we can only update to 8.0.16 at present. We can't find the commit of 8.0.17. And is 8.0.17 released?

Could you please provide a work around to us so that we can apply a patch to unblock our task to build MySQL with MSVC on windows.

Thanks,
Lin
[27 May 2019 10:19] Erlend Dahl
Diff for uca9-dump.cc

Attachment: uca9.diff (text/x-patch), 934 bytes.

[27 May 2019 10:20] Erlend Dahl
Diff for router source

Attachment: router.diff (text/x-patch), 321 bytes.

[27 May 2019 10:20] Erlend Dahl
8.0.17 has not been released yet.

In the meantime, you can try the two attached diffs.