Questions tagged [clang-cl]

clang-cl is an alternative command line interface to Clang, which is part of the LLVM project. It is designed for compatibility with Microsoft's cl.exe. Use this tag for problems encountered that are specific to using clang-cl.

clang-cl is an alternative command line interface to Clang. Part of the LLVM project, it is designed for compatibility with Microsoft's Visual C++ compiler, cl.exe.

See the documentation for details on setting up and configuring your system to use it.

46 questions
9
votes
2 answers

How to circumvent Windows Universal CRT headers dependency on vcruntime.h

In trying to evaluate Clang on Windows, utilizing the Windows Universal C Run-Time (...\Windows Kits\10\Include\10.0.15063.0\ucrt) I was immediately facing unexpected wall, in the form of an undisclosed and unexpected dependency on Microsoft's…
Ron Pinkas
  • 357
  • 2
  • 10
9
votes
1 answer

Using OpenMP 3/4 in Visual Studio 2017

Trying to use features from OpenMP 3 #pragma omp parallel for collapse(2) in Visual Studio 2017; i'm getting error c3005: 'collapse' unexpected token encountered on openmp 'parallel for' directive It seems Visual Studio 2017 only supports OpenMP2.…
Roi Danton
  • 7,933
  • 6
  • 68
  • 80
7
votes
3 answers

How to use Clang-CL LLVM with VS2019 CMAKE?

As of writing clang has this documentation on their user manual for Visual Studio: cmake -G"Visual Studio 2017" -T LLVM .. This doesn't work. I get this mess of an error message from cmake: CMake Error at CMakeLists.txt:3 (project): Failed to run…
user8197171
7
votes
1 answer

CMake building for Windows (clang-cl) using Ninja Generator

I am trying to build a simple application on a Windows machine using CMake as the main build tool. Once CMake is invoked on the project the is an error on configuration phase: > cmake -H. -G Ninja -Bbuild -DCMAKE_C_COMPILER:PATH="C:\Program…
maxik
  • 1,053
  • 13
  • 34
6
votes
1 answer

How to disable clang-cl specific warnings in VS project

I use a 3rd party project, that produces huge amount of warnings. I disable all of them in VS project properties. Sometimes, I switch to LLVM clang-cl toolset to check for warnings from clang. The 3rd party project produces so many warnings with…
Pavel P
  • 15,789
  • 11
  • 79
  • 128
6
votes
1 answer

clang, std::function and -fno-rtti

I am using Clang 5 on Windows via clang-cl and have run into a problem trying to turn off runtime type information (-fno-rtti) when using std::function. Here's my example that won't compile: #include void foo(std::function
keith
  • 5,122
  • 3
  • 21
  • 50
4
votes
0 answers

Unable to build using clang-cl, CMake, and Ninja from a terminal

There are plenty of questions and answers relating to this, but none of them have gotten me past my current problem. I can build using CMake/Ninja/clang-cl fine from within Visual Studio, but I want this to be done within a Github Action so I need…
cmannett85
  • 21,725
  • 8
  • 76
  • 119
4
votes
1 answer

Using Clang on Windows 10 with LLD

Compiling a simple hello world program generates warnings when compiling with clang. I understand that using clang-cl will get rid of the warnings. On Clang's website, it states: "clang-cl is an alternative command-line interface to Clang, designed…
Ryan
  • 1,486
  • 4
  • 18
  • 28
4
votes
1 answer

Debug variadic arguments

I'm currently debugging an issue in our build where in variadic arguments, the number of arguments ain't as expected. Currently my code looks similar to: class CustomException : public BaseException { public: template
JVApen
  • 11,008
  • 5
  • 31
  • 67
4
votes
2 answers

Refactor MFC message maps to include fully qualified member function pointers

I have a codebase where MFC message maps are written in this form: BEGIN_MESSAGE_MAP(SomeForm, BaseForm) ON_COMMAND(CID_ButtonAction, OnButtonAction) END_MESSAGE_MAP() This compiles just fine in MSVC. When I want to compile the same code in…
pablo285
  • 2,460
  • 4
  • 14
  • 38
3
votes
1 answer

declspec error when compiling clang's along with Windows headers

I'm trying to get a project of mine building on Windows, which is a first for me. I'm a beginner to the platform. I'm using clang-cl to support C11. The source originally used noreturn from to annotate function that will never…
nickelpro
  • 2,537
  • 1
  • 19
  • 25
3
votes
2 answers

Is it possible to generate a .lib file on windows using clang-cl?

I am on Windows and I have Visual Studio installed and the latest version of clang. I am able to run: clang-cl hello.c Which in turn generates hello.exe, which I can run as expected. But what I want to do is to generate a static library instead…
justin.m.chase
  • 13,061
  • 8
  • 52
  • 100
2
votes
1 answer

Setting up Pythran for compiling on Windows with clang-cl.exe and OpenMP working: need a way to pass compiler arguments

I'm using Pythran to compile Python code into C/C++ with OpenMP support on Windows. Now the documentation isn't great for Windows - it states: "Windows support is on going and only targets Python 3.5+ with either Visual Studio 2017 or, better,…
Matt
  • 2,602
  • 13
  • 36
2
votes
0 answers

Using c++20 modules with Visual Studio and Clang-cl 13

Recently, I tried to use modules with VS2022, Clang-cl-13. I followed the instructions I found. Enabled std:c++latest and experimental:module. Created a most-basic module file (Module.ixx): export module Module; export int MyFunc() { return…
Newline
  • 769
  • 3
  • 12
2
votes
0 answers

Visual Studio - mixing windows clang compiler (VS2019 clang-cl) with QT5 built with VS2017

I was able to run a debug configuration built with clang-cl (latest clang that comes with VS-2019) with a custom QT built with VS-2017 without any issues. If I try to build my QT app using the Win64 Release configuration (against same QT VS-2017,…
Ghita
  • 4,465
  • 4
  • 42
  • 69
1
2 3 4