12-21-2023 02:18 PM
We need to cross compile some C/C++ code and create a callable .so file.
I have successfully setup the environment, compiled, deployed, and called a sample .so file using the 2018-2019 tool chain setup. My efforts to update to either 23Q1 or 23Q4 have failed. Below are the errors received when trying to 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/23Q1/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/23Q1/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.28/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/build/23Q1/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: 'C:/Users/<user>/Documents/sharedObject/build/CMakeFiles/CMakeScratch/TryCompile-rv8yrf'
Run Build Command(s): C:/PROGRA~1/Ninja/ninja.exe -v cmTC_b6864
[1/2] C:\build\23Q1\x64\sysroots\x86_64-w64-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gcc.exe -O2 -pipe -g -feliminate-unused-debug-types -o CMakeFiles\cmTC_b6864.dir\testCCompiler.c.o -c C:\Users\<user>\Documents\sharedObject\build\CMakeFiles\CMakeScratch\TryCompile-rv8yrf\testCCompiler.c
FAILED: CMakeFiles/cmTC_b6864.dir/testCCompiler.c.o
C:\build\23Q1\x64\sysroots\x86_64-w64-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gcc.exe -O2 -pipe -g -feliminate-unused-debug-types -o CMakeFiles\cmTC_b6864.dir\testCCompiler.c.o -c C:\Users\<user>\Documents\sharedObject\build\CMakeFiles\CMakeScratch\TryCompile-rv8yrf\testCCompiler.c
ninja: build stopped: subcommand failed.
Could someone please point me in the right direction to fix this?
12-22-2023 12:02 AM - edited 12-22-2023 12:02 AM
Those docs have a bunch of issues right now.
The batch file in the download is causing double slashes "\\" in the paths its setting in environment variables if you look closely. Take out the '\' after the %SDKROOT% in the batch file and try again.
Those VS Code instructions are suggesting some bad practices and my ticket from years ago on the github for those docs has gone unnoticed.
12-22-2023 11:29 AM
Welp - Tried that and still broken.
-- 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/23Q1/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/23Q1/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.28/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/build/23Q1/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: 'C:/Users/<user>/Documents/sharedObject/build/CMakeFiles/CMakeScratch/TryCompile-fj531i'
Run Build Command(s): C:/PROGRA~1/Ninja/ninja.exe -v cmTC_71907
[1/2] C:\build\23Q1\x64\sysroots\x86_64-w64-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gcc.exe -O2 -pipe -g -feliminate-unused-debug-types -o CMakeFiles\cmTC_71907.dir\testCCompiler.c.o -c C:\Users\<user>\Documents\sharedObject\build\CMakeFiles\CMakeScratch\TryCompile-fj531i\testCCompiler.c
FAILED: CMakeFiles/cmTC_71907.dir/testCCompiler.c.o
C:\build\23Q1\x64\sysroots\x86_64-w64-mingw32\usr\bin\x86_64-nilrt-linux\x86_64-nilrt-linux-gcc.exe -O2 -pipe -g -feliminate-unused-debug-types -o CMakeFiles\cmTC_71907.dir\testCCompiler.c.o -c C:\Users\<user>\Documents\sharedObject\build\CMakeFiles\CMakeScratch\TryCompile-fj531i\testCCompiler.c
x86_64-nilrt-linux-gcc.exe: fatal error: cannot execute 'c:/build/23q1/x64/sysroots/x86_64-w64-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc/x86_64-nilrt-linux/10.3.0/as.exe': CreateProcess: No such file or directory
compilation terminated.
C:\Users\<user>\Documents\sharedObject\build\CMakeFiles\CMakeScratch\TryCompile-fj531i\testCCompiler.c:11:1: fatal error: error closing -: Invalid argument
11 | { (void)argv; return argc-1;}
| ^
compilation terminated.
ninja: build stopped: subcommand failed.
This is a new error however:
11 | { (void)argv; return argc-1;}
| ^
Feeling kinda dumb here. Been building C/C++ for years but always had the luxury of a fully integrated IDE.
12-24-2023 07:28 PM
that looks like you copied the examples including the line numbers.
You should still get to a point where cmake can identify the compilers (first two lines)
12-28-2023 10:20 AM
@IlluminatedG wrote:
that looks like you copied the examples including the line numbers.
Not sure what you mean by this. What I posted is a copy of the output after trying what you suggested.
01-15-2024 02:04 PM
Hello!
Do you have any updates on the topic? I have the same issue and could not find a solution yet.
Any info would be really helpful.
Thanks
01-15-2024 03:16 PM
Sorry no useful updates I am afraid. Because of project time constraints we just reverted back to the 2018-2019 tool chain setup. It works fine.