[CONC-645] Fix compile errors with Windows clang.exe Created: 2023-05-16  Updated: 2023-09-22  Resolved: 2023-09-22

Status: Closed
Project: MariaDB Connector/C
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.1.23, 3.3.8

Type: Bug Priority: Minor
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File out.txt     File patch.diff    

 Description   

When I try to compile with clang.exe, there are come compile errors. I get the clang.exe from VS2022 distribution.

Note : unlike its sibling clang-cl.exe, this compiler does not disguise itself as MSVC, but GCC instead. However, it is still bona-fide Windows compiler, wrt ABI and Windows headers. The only GCC-ism about it is that it accepts the GCC style command parameters.

Execute below command in "x64 Native Tool Command Prompt" of VS2022 installation.

cmake .. -DCMAKE_C_COMPILER="C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/Llvm/x64/bin/clang.exe"  -GNinja
ninja

It spits out some errors. Apparently, CMake wants to compile mariadb_config which needs
getopt.h and unistd.h.
There is also some stuff we had not seen for a long time, which is winsock.h vs winsock2.h headers.
see out.txt for a full output

A patch is attached. patch.diff



 Comments   
Comment by Vladislav Vaintroub [ 2023-05-16 ]

Sorry @Diego, this is obviously Connector/C related, I missed the correct project when creating it. Can you move it there? (I can't on some reason)

Comment by Diego Dupin [ 2023-05-16 ]

wlad moved

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