Open wmurw opened 2 months ago
Could you please try 19 or main
branch? https://godbolt.org should be helpful.
At https://godbolt.org/ everything works in x86-64 clang 18.1.0 - no this problem there I installed clang using LLVM-18.1.8-win64.exe I don't understand how to use clang 19.
I believe godbolt.org uses std not from microsoft, so it works there. But I have clang using microcoft's std by default. The -I and -L keys pointing to include and lib from MinGW don't change anything. I was able to use MinGW's std using the clang --target=x86_64-w64-mingw32 switch, but this only works without OpenMP. The key combination --target=x86_64-w64-mingw32 -fopenmp gives an error:
C:\mingw64\bin\ld.exe: cannot find -lomp: No such file or directory
clang++: error: linker command failed with exit code 1
MinGW compiles OpenMP programs without this error.
MinGW is taken from here, variant: x86_64-13.2.0-release-posix-seh-msvcrt-rt_v11-rev0.
clang 18.1.8 from msys2 doesn't have this problem I want llvm-project to be free of it.
I am having the same issue, clang 18.1.8 from windows visual studio. OpenMP and format libraries do not work together.
@llvm/issue-subscribers-clang-frontend
Author: Юрий Муравьёв (wmurw)
clang 18.1.8 clang 17.0.3 (from Visual Studio 2022)
Under windows code:
when compiling:
clang++ main.cpp -std=c++23 -O2 -fopenmp
generates an error:although
format
is not used here and there is not even#include <format>
(it is insideiostream
andchrono
) Without#include <chrono>
the code compiles with-std=c++20
There is no problem when compiling msvc, although the same microsoft header files are used.
When compiling MinGW with its alternative
std
there is no problem either.