Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-645

Fix compile errors with Windows clang.exe

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 3.1.23, 3.3.8
    • Build
    • None

    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

      Attachments

        1. patch.diff
          2 kB
        2. out.txt
          14 kB

        Activity

          People

            wlad Vladislav Vaintroub
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.