[CONCPP-110] Compile connector c++ with Visual Studio 2022 Created: 2022-11-07 Updated: 2022-11-16 Resolved: 2022-11-16 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C++ |
| Component/s: | General |
| Affects Version/s: | 1.0.2 |
| Fix Version/s: | 1.1.2, 1.0.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Axel Sjöberg | Assignee: | Lawrin Novitsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows Server 2016 standard, Visual Studio 2022, conan package manager, |
||
| Attachments: |
|
| Description |
|
I'm in the progress of transition from Visual Studio 2017 to 2022. When trying to compile the c++ connector, I get the error shown in the attachments. I have created Conan package manager recipes for the connector and I provided them too, including my conan profile file. Compiling with or without Conan, I still end up having the compilation abort with the same dynamic_cast error. I have also tried to build with MSBuild and Ninja. I have exhausted my ideas about how to fix this. |
| Comments |
| Comment by Lawrin Novitsky [ 2022-11-15 ] |
|
Thank you for your report. Could you give me complete instruction with exact commands how to repeat it? Preferably w/out Conan. I gather you were taking release source package, as the first step. |
| Comment by Axel Sjöberg [ 2022-11-15 ] |
|
I tried it again, this time by getting the source code from github as opposed to downloading it from the connectors downloads page. Unfortunately it failed again. *C:\mariadbconnector>git clone https://github.com/mariadb-corporation/mariadb-connector-cpp.git Compiling results in these errors: zutil.c Earlier I tried compiling the c++ connector by downloading it from the downloads connectors page. Because the libmariadb folder is empty in the downloaded c++ connector source files, I manually then copied the c connector source code from the same downloads page into the libmariadb folder. Essentially a manual git submodule init. The cmake commands to compile I did just like above. I have also tried changing compilation options like WITH_MSI and the like that you can find in src/cmake/options_defaults.cmake. |
| Comment by Lawrin Novitsky [ 2022-11-15 ] |
|
Thanks. I haven't tried to repeat - at first look there is nothing fancy in your instructions. But I've made change that may please your compiler, based on the error message I saw on the screenshot. Could you please try to build from the https://github.com/mariadb-corporation/mariadb-connector-cpp/tree/1.0-concpp-110 branch? |
| Comment by Axel Sjöberg [ 2022-11-15 ] |
|
The SimpleParameterMetaData.cpp compilation error is gone! QueryProtocol.cpp error is still there. The "error MSB8066: Custom build" error disappears if I set WITH_MSI=OFF. Whatever you did to the first .cpp file, can you do to the second? |
| Comment by Lawrin Novitsky [ 2022-11-15 ] |
|
I can't see the same thing in the QueryProtocol.cpp |
| Comment by Lawrin Novitsky [ 2022-11-15 ] |
|
Could you please try with the same branch once again? Please mind, that I have overwrote previous commit there |
| Comment by Axel Sjöberg [ 2022-11-16 ] |
|
It works! Thanks a lot! Below is my recipe for building this patch. An official mariadb-connector-cpp package recipe to https://github.com/conan-io/conan-center-index would be great! Mariadb-connector-c can already be found there, but its version is quite old. def source(self): def build(self): def package(self): def package_info(self): |
| Comment by Lawrin Novitsky [ 2022-11-16 ] |
|
I am closing the issue then. It's a bit interesting, what is wrong with MSI assembling, but unlikely anybody needs MSI, except us, and for us it works |