02-11-2025 12:19 PM
Is there a tutorial anywhere about getting a new/modern Clang set up in LabWindows?
I see LabWindows has options for different compilers, and has templates for them -- but the 3.3 won't work with the current Clang.
I played with this a bit trying to point it to the new Clang, and update the Warning Level command line options, but still don't have it all going. It cannot find things like utility.h or windows.h.
Tips apprecaite.
02-11-2025 03:01 PM
My research so far:
Clang 19 download: https://github.com/llvm/llvm-project/releases/tag/llvmorg-19.1.0
I downloaded "LLVM-19.1.0-win64.exe" which installs clang.exe here:
C:\Program Files\LLVM\bin
In LabWindows:
For the batch file, I just used the default. It checks for the existence of the %CVIDIR% environment variable, then checks to see if "%CVIDIR%\include\clang" and "%CVIDIR%\include\clang\3.3" exist. Ideally, this would need to be updated for the new clang header files.
BUT, the help file entry "Factors to Consider When Creating or Editing a Compiler Configuration" has this note:
Include Paths
—You must use the LabWindows/CVI include paths, not the external compiler include paths. It might be necessary to set a flag to instruct the external compiler to disregard its include paths. If you must use an include file the external compiler provides, add that include file to the LabWindows/CVI project.
Can this NOT use the updated C header files with Clang 19? Once I did these steps, I can build and link. I do not know how to verify it is using the clang.exe I pointed it to, versus the built-in 3.3.
Is there a write-up on how to do this?
02-13-2025 10:01 AM
I would try to see what the compiler is defining for __STDC_VERSION__. With Clang 19.1, it looks like it should be 202311 (C23), but you could end up with 201710 (C17). The version shipping with CVI 2020 is defined as 199901 (C99)
char szMessage[48];
sprintf (szMessage, "STDC Version: %lu", __STDC_VERSION__);
MessagePopup ("STC Version", szMessage);