0

To solve my problem here with Checked C Clang, from this post I figured out that first I should add the compiler to the environment system variables path:

set PATH=%PATH%;"C:\tools\msys64\mingw64\bin"

then compile the file with

clang <fileName>.c --verbose -target x86_64-pc-windows-gnu

which didn't help. For some reason it looks for the Mingw include folders in a strange place:

ignoring nonexistent directory "C:\Program Files\CheckedC-Clang\x86_64-w64-mingw32/sys-root/mingw/include"
ignoring nonexistent directory "C:\Program Files\CheckedC-Clang\x86_64-w64-mingw32\include"

I also tried to add the Mingw-w64 include folder:

clang <fileName>.c --verbose -target x86_64-pc-windows-gnu -I"C:\tools\msys64\mingw64\include"

to no avail. It fails to find the stdio.h header file even when searching the folder!

#include <...> search starts here:
C:\tools\msys64\mingw64\include

I would appreciate it if you could help me know what should I do so Clang can find the Mingw-w64 GCC headers installed via MSYS2.

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackoverflow.com/rooms/249515/discussion-on-question-by-foad-s-farimani-how-to-add-mingw-w64-gcc-to-the-path). – Dharman Nov 11 '22 at 12:50
  • @Dharman I did not appreciate you doing this. Chat is a useless feature of the SO platform, to put it politely. they are shortlived, and not indexed by search engines. IMHO you did nothing good for me, for other people involved in the conversation, for the SO advertisement business model, or the future users who might have similar issues. – Foad S. Farimani Nov 12 '22 at 07:37
  • Comments are even more short-lived. I could have just purged all comments but I moved them to chat to preserve them. If there was anything interesting in the comments you should update the question with that information. – Dharman Nov 12 '22 at 11:53

0 Answers0