Compile test invokes wrong ar.exe

Hi, I am trying to configure CMakePresets to build an embedded application using the armclang compiler running on Windows. I’ve succeed when running within an ARM Developer Studio command prompt, which sets up the necessary environment, but not when running from a normal Windows Command Prompt and setting the environment in CMakePresets.json. So something is wrong with my environment settings.

What I see is:

[cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):

[cmake]   The C compiler


[cmake]     "C:/Program Files/Arm/Development Studio 2021.1/sw/ARMCompiler6.16/bin/armclang.exe"


[cmake]   is not able to compile a simple test program.


[cmake]   It fails with the following output:


[cmake]     Change Dir: C:/SVNProj/Elysion/trunk/software/prototypes/elysion_arm/builds/windows-elysion/CMakeFiles/CMakeTmp


[cmake]     Run Build Command(s):C:/ti/xdctools_3_25_02_70/gmake.exe -f Makefile cmTC_2fd2e/fast && C:/ti/xdctools_3_25_02_70/gmake.exe  -f CMakeFiles/cmTC_2fd2e.dir/build.make CMakeFiles/cmTC_2fd2e.dir/build

[cmake]     gmake.exe[1]: Entering directory `C:/SVNProj/Elysion/trunk/software/prototypes/elysion_arm/builds/windows-elysion/CMakeFiles/CMakeTmp'

[cmake]     Building C object CMakeFiles/cmTC_2fd2e.dir/testCCompiler.o

[cmake]     "C:/Program Files/Arm/Development Studio 2021.1/sw/ARMCompiler6.16/bin/armclang.exe" --target=arm-arm-none-eabi    -MD -MT CMakeFiles/cmTC_2fd2e.dir/testCCompiler.o -MF CMakeFiles/cmTC_2fd2e.dir/testCCompiler.o.d -o CMakeFiles/cmTC_2fd2e.dir/testCCompiler.o -c C:/SVNProj/Elysion/trunk/software/prototypes/elysion_arm/builds/windows-elysion/CMakeFiles/CMakeTmp/testCCompiler.c

[cmake]     warning: 'armv4t' is unsupported in this version of the product

[cmake]     warning: 'arm7tdmi' is unsupported in this version of the product

[cmake]     Linking C static library libcmTC_2fd2e.a

[cmake]     "C:/Program Files/CMake/bin/cmake.exe" -P CMakeFiles/cmTC_2fd2e.dir/cmake_clean_target.cmake

[cmake]     C:/Strawberry/c/bin/ar.exe --create -cr libcmTC_2fd2e.a "CMakeFiles/cmTC_2fd2e.dir/testCCompiler.o"

[cmake]     C:/Strawberry/c/bin/ar.exe: unknown option -- create

I think the Strawberry tools on this laptop are for Perl. I guess the wrong ar.exe is getting called. Any idea which program should be called please? Perhaps then I can determine what’s wrong with the environment settings.

It’s probably some ar shipped under Arm/Development Studio I’d imagine. Alternatively, you can boot C:/Strawberry from PATH for this environment.

Thanks, removing C:/Strawberry from PATH fixed it.