10-11-2024 03:28 AM - edited 10-11-2024 03:30 AM
Hello,
I followed all steps from nilrt-docs.ni.com and was not able to compile helloworld.c example, I get the following error in the terminal:
Executing task: cmake -G Ninja D:\projects-git\helloworld/build
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/build/2023q4/x64/sysroots/x86_64-w64-mingw32/usr/bin/x86_64-nilrt-linux/x86_64-nilrt-linux-gcc.exe
-- Check for working C compiler: C:/build/2023q4/x64/sysroots/x86_64-w64-mingw32/usr/bin/x86_64-nilrt-linux/x86_64-nilrt-linux-gcc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/build/2023q4/x64/sysroots/x86_64-w64-mingw32/usr/bin/x86_64-nilrt-linux/x86_64-nilrt-linux-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'D:/projects-git/helloworld/build/CMakeFiles/CMakeScratch/TryCompile-rb58ib'
Run Build Command(s): C:/PROGRA~1/Ninja/ninja.exe -v cmTC_5e2f8
[1/2] C:\build\2023q4\x64\sysroots\x86_64-w64-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gcc.exe -o CMakeFiles\cmTC_5e2f8.dir\testCCompiler.c.o -c D:\projects-git\helloworld\build\CMakeFiles\CMakeScratch\TryCompile-rb58ib\testCCompiler.c
FAILED: CMakeFiles/cmTC_5e2f8.dir/testCCompiler.c.o
C:\build\2023q4\x64\sysroots\x86_64-w64-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gcc.exe -o CMakeFiles\cmTC_5e2f8.dir\testCCompiler.c.o -c D:\projects-git\helloworld\build\CMakeFiles\CMakeScratch\TryCompile-rb58ib\testCCompiler.c
x86_64-nilrt-linux-gcc.exe: fatal error: cannot execute 'c:/build/2023q4/x64/sysroots/x86_64-w64-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc/x86_64-nilrt-linux/11.3.0/as.exe': CreateProcess: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:18 (project)
-- Configuring incomplete, errors occurred!
I attached also the CMakeConfigureLog.yaml file. It seems that the compilers are not working for some reason, any ideas why?
Thank you!
Solved! Go to Solution.
10-11-2024 09:50 AM
Make sure you unpack the toolchain as admin and also make sure the libwinpthread.dll (or something like that) can be found in a folder on the path environment variable. Try running the cross-compiler directly from explorer or a terminal and see what errors you get. You can just use '--version' with it to try reading the toolchain version info and ensure it actually runs.
10-14-2024 06:43 AM
Problem solved after unpacking the toolchain again by starting 7zip as admin. Something went wrong before, I could read the compiler version from terminal but could not compile the simple example. Thanks @IlluminatedG!
10-15-2024 09:10 PM
The toolchain utilizes symlinks in its folder hierarchy, which is a bit unconventional on Windows, and 7zip can't create those unless it's running as admin. It also has multiple capitalizations for some files which makes sense for a Linux system (well not really, who needs multiple capitalizations in an environment that's case sensitive?) and Windows can't handle those either so that results in some noisy errors that don't impact usage. I'm really curious if R&D does any cross-compilation from Windows environments.
03-10-2026 08:44 AM
Hello IlluminatedG,
I am running into the same problem. The unzip did not unzip okay. Eventually I did ignore all the Linux symlinks (in core2-64-nilrt-linux) as I assumed the zip contains the compiler to use on a Linux development PC and the compiler which can be run on a windows machine. Now I have a sysroot folder which contains:
core2-64-nilrt-linux
x86_64-w64-mingw32
Reading this forum makes me think I am wrong and need both directories is this correct?
I did run:
sysroots\x86_64-w64-mingw32\usr\bin>make --version
and I got this reply:
GNU Make 4.3
Built for x86_64-w64-mingw32
....
can you please tell if I need both folders and if the make is the command you are revering to? I'll try to unpack the zip as admin now.
03-10-2026 10:43 AM
I tried to run 7-zip as an admin, it does not allow me to process the links. I get a lot of:
Dangerous link path was ignored: \....*so
did you use some kind of setting? I can not find it in 7-zip, how did you solve it?
03-10-2026 05:48 PM
If upgrading to a version that is 2024 Q4 or newer is an option, you can use NI Package Manager to install the toolchain. This removes the dependency on third party tools to like 7-zip. The screenshot below uses 2025 Q4 as an example: