[CONCPP-61] Connector/C++ Window Build Error Created: 2021-02-04  Updated: 2021-02-09  Resolved: 2021-02-05

Status: Closed
Project: MariaDB Connector/C++
Component/s: General
Affects Version/s: None
Fix Version/s: 1.0.0

Type: Bug Priority: Major
Reporter: hyun Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

[Env]
Win10
VS2015

[Bug]
1. jdbccompat.hpp
Build Error at enum ClientInfoStatus{}
Can build when delete enum ClientInfoStatus{}. but i don't know the side effect
-------------
I Found it. The error wat "expected an identifier"
with enum ClientInfoStatus

{REASON_UNKNOWN}

Windows Kits\8.1\Include\um\winreg.h (line 1326)

So change REASON_UNKNOWN name.

Thanks for reply.

2. SQLString.hpp
Build Error at 49 line std::string::npos;
Can build when change std::string::npos; to -1



 Comments   
Comment by Lawrin Novitsky [ 2021-02-04 ]

Thank you for your report. I don't have VW2015 by hand, and in VS2019 it's compiled well.

Could you please provide exact text of compiler errors?

Removing ClientInfoStatus is not an option.
Would changing const to constexpr, i.e. static constexpr std::size_t npos= std::string::npos; in SQLString.hpp amend that issue?

Comment by Lawrin Novitsky [ 2021-02-04 ]

I actually found VS2015 on our build machine connector compiles there without errors, I can see errors. The first time it was other Studio used, also installed there

Comment by Lawrin Novitsky [ 2021-02-04 ]

I changed only npos. That fixed the build for me. If it doesn't for you - than please re-open with the new comments.
Eventually, I had initialize it with -1 casted to size_t

Comment by Lawrin Novitsky [ 2021-02-05 ]

Ok. I see, there define REASON_UNKNOWN in that windows header. Name needs to be changed. Thanks

Comment by Lawrin Novitsky [ 2021-02-05 ]

New commit is 623eefe. Renamed REASON_UNKNOWN to _REASON_UNKNOWN

Generated at Thu Feb 08 03:08:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.