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.