Detecting compiler ABI failed by CMAKE - c++

There is a CMake project simple enough but not compiling at all with Visual Studio Code. The source:
// main.cpp
#include <iostream>
int main(int argc, char * argv){
return 0;
}
The CMakeLists.txt:
cmake_minimum_required(VERSION 3.0.0)
project(test VERSION 0.1.0)
add_executable(test main.cpp)
CMake Tools in vscode build with errors in prompt as below:
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - failed
[cmake] -- Check for working C compiler: /bin/gcc-9
[cmake] -- Check for working C compiler: /bin/gcc-9 - works
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] CMake Error at /usr/local/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:82
(configure_file):
[cmake] configure_file Problem configuring file
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:2 (project)
[cmake]
[cmake]
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - failed
[cmake] -- Check for working CXX compiler: /bin/g++-9
[cmake] -- Check for working CXX compiler: /bin/g++-9 - works
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] CMake Error at /usr/local/share/cmake-3.18/Modules/CMakeTestCXXCompiler.cmake:75
(configure_file):
[cmake] configure_file Problem configuring file
[cmake] Call Stack (most recent call first):
[cmake] CMakeLists.txt:2 (project)
The CMakeError.log:
Cannot copy output executable
'/data/solution/projects/test/build/CMakeFiles/CMakeTmp/cmTC_efc0d'
to destination specified by COPY_FILE:
'/data/solution/projects/test/build/CMakeFiles/3.18.4/CMakeDetermineCompilerABI_C.bin'
Cannot copy output executable
'/data/solution/projects/test/build/CMakeFiles/CMakeTmp/cmTC_26771'
to destination specified by COPY_FILE:
'/data/solution/projects/test/build/CMakeFiles/3.18.4/CMakeDetermineCompilerABI_CXX.bin'
A selection of the CMakeOutput.log:
The system is: Linux - 5.4.0-52-generic - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /bin/gcc-9
Build flags:
Id flags:
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
The C compiler identification is GNU, found in
"/data/solution/projects/test/build/CMakeFiles/3.18.4/CompilerIdC/a.out"
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /bin/g++-9
Build flags:
Id flags:
The output was:
0
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"
The CXX compiler identification is GNU, found in
"/data/solution/projects/test/build/CMakeFiles/3.18.4/CompilerIdCXX/a.out"
Determining if the C compiler works passed with the following output:
Change Dir: /data/solution/projects/test/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_3f39e/fast && /usr/bin/make -f
CMakeFiles/cmTC_3f39e.dir/build.make CMakeFiles/cmTC_3f39e.dir/build
make[1]: Entering directory '/data/solution/projects/test/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3f39e.dir/testCCompiler.c.o
/bin/gcc-9 -o CMakeFiles/cmTC_3f39e.dir/testCCompiler.c.o -c
/data/solution/projects/test/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_3f39e
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3f39e.dir/link.txt --verbose=1
/bin/gcc-9 -rdynamic CMakeFiles/cmTC_3f39e.dir/testCCompiler.c.o -o cmTC_3f39e
make[1]: Leaving directory '/data/solution/projects/test/build/CMakeFiles/CMakeTmp'
The project doesn't build anymore when the OS was upgraded from 18.04 to 20.04 all in a sudden, with later version (9.3) of GCC toolchain. The
a.out
exists under CMAKE building directory, but there is no output executable ABI testing program to copy to anyway, as we can tell from the above logs. Is there anyone to help me finding the real cause? Thank you.
Solution: OK. There is an issue I could have noted, thanks to a comment. The project is under directory mounted to FAT32 file system where permission settings are tricky to configure. A correct /etc/fstab file:
UUID=3FCE-E5CB /data vfat rw,user,exec,utf8,uid=jack,gid=jack 0 0

The CMAKE is not able to access to file system with permission granted. Solution is to edit /etc/fstab accordingly.

Related

Movesense can't generate ninja files according to documentation

C++ development and related evironments are not something I use so I might be missing som knowledge in this area.
I want to do som sensor programming and want to deploy the example-project to get it working and then write my own code to extend it there after.
I've managed running projects in the Simulator using Visual Studio 2017.
But couldn't get building example-project using Visual Studio C++ Compiler working so installed MinGW firstly: https://sourceforge.net/projects/mingw/
But following the instructions at https://movesense.com/docs/esw/getting_started/#example-project
I can't run the create ninja files step correctly.
I get this error running the command:
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=../movesense-device-lib/MovesenseCoreLib/toolchain/gcc-nrf52.cmake -DMOVESENSE_CORE_LIBRARY=../movesense-device-lib/MovesenseCoreLib ../ -DCMAKE_BUILD_TYPE=Debug ../
CMake Warning:
Ignoring extra path from command line:
"C:/Development/movesense-device-lib/MovesenseCoreLib/toolchain/gcc-nrf52.cmake"
CMake Warning:
Ignoring extra path from command line:
"../movesense-device-lib/MovesenseCoreLib"
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/MinGW/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: C:/MinGW/bin/gcc.exe
CMake Error at CMakeLists.txt:13 (include):
include could not find requested file:
C:/Development/builddir//MovesenseFromStaticLib.cmake
Adding the MovesenseFromStaticLib.cmake manually doesn't work either gives me these errors:
Ignoring extra path from command line:
"C:/Development/movesense-device-lib/MovesenseCoreLib/toolchain/gcc-nrf52.cmake"
CMake Warning:
Ignoring extra path from command line:
"../movesense-device-lib/MovesenseCoreLib"
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/MinGW/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: C:/MinGW/bin/gcc.exe
CMake Error at builddir/MovesenseFromStaticLib.cmake:29 (include):
include could not find requested file:
C:/Development/builddir/app-build/toolchain-setup.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
CMake Error at builddir/MovesenseFromStaticLib.cmake:30 (include):
include could not find requested file:
C:/Development/builddir/app-build/prolog.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
CMake Error at builddir/MovesenseFromStaticLib.cmake:32 (include):
include could not find requested file:
C:/Development/builddir/app-build/platform/.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
CMake Error at builddir/MovesenseFromStaticLib.cmake:33 (include):
include could not find requested file:
C:/Development/builddir/app-build/compiler/.cmake
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
CMake Error at builddir/MovesenseFromStaticLib.cmake:40 (INIT_SIMULATOR_ENVIRONMENT):
Unknown CMake command "INIT_SIMULATOR_ENVIRONMENT".
Call Stack (most recent call first):
CMakeLists.txt:13 (include)
-- Configuring incomplete, errors occurred!
Like Tsyvarev mentioned should be space after -D, but still get:
cmake -G "Ninja" -D CMAKE_TOOLCHAIN_FILE=../movesense-device-lib/MovesenseCoreLib/toolchain/gcc-nrf52.cmake -D MOVESENSE_CORE_LIBRARY=../movesense-device-lib/MovesenseCoreLib ../ -D CMAKE_BUILD_TYPE=Debug ../
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
The CMAKE_C_COMPILER:
arm-none-eabi-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error in CMakeLists.txt:
The CMAKE_CXX_COMPILER:
arm-none-eabi-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
The CMakeLists.txt look like this:
cmake_minimum_required(VERSION 3.4)
enable_language(C CXX ASM)
if(NOT DEFINED MOVESENSE_CORE_LIBRARY)
# Give error that user must provide path to movescount-core library
message(FATAL_ERROR "Path to movesense-core library not set. Add -DMOVESENSE_CORE_LIBRARY=<path_to_core_lib> to cmake command line")
endif()
if(NOT IS_ABSOLUTE ${MOVESENSE_CORE_LIBRARY})
set(MOVESENSE_CORE_LIBRARY ${CMAKE_BINARY_DIR}/${MOVESENSE_CORE_LIBRARY})
endif()
include(${MOVESENSE_CORE_LIBRARY}/MovesenseFromStaticLib.cmake REQUIRED)
Any help on what is the issue and how to solve it?
You are trying to build the project on the MinGW terminal in windows instead of the Docker container as described in the documentation:
https://movesense.com/docs/esw/getting_started/#build-commands-real-hw
Starting Movesense 2.0 the docker environment is the only supported build environment.
Full disclosure: I work for the Movesense

Trouble launching QApplication class with VSCode & C++

I am new to C++ as well as VSCode, so this issue might have a really simple answer I'm just overlooking. I'm trying to build an application using the Qt library after having loved its PyQt variant, but I cannot get the simplest possible app to launch from the VSCode terminal.
Here's the program I try to build and run:
// main.cpp - I copied and pasted the Qt documentation example after I had Qt import issues
// (which I have since resolved)
#include <iostream>
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
std::cout << "So far";
QApplication qga (argc, argv);
QPushButton btn ("ayo");
btn.show();
return qga.exec();
}
Here's the CMakeLists.txt file that builds the app:
cmake_minimum_required(VERSION 3.16)
project(trial VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_PREFIX_PATH "C:/Qt/6.3.0/mingw_64/")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt6 REQUIRED COMPONENTS Widgets Gui Core)
qt_standard_project_setup()
add_executable(trial main.cpp)
target_link_libraries(trial PRIVATE Qt6::Widgets Qt6::Gui Qt6::Core)
include(CPack)
These are the components I'm using:
VS Code 2017
CMake (extension)
CMake Tools (extension)
Qt tools (extension)
GCC 8.1.0x86_64-w64-mingw32 compiler
Qt 6.3.0
What confuses me is that the program builds seemingly without error - the program finds Qt and throws no error when compiling. But whenever I launch it from the VS Code terminal, nothing happens. No statement is printed nor is any window launched.
In case it helps, here's the output when I try to launch it:
[variant] Loaded new set of variants
[kit] Successfully loaded 5 kits from C:\Users\astro\AppData\Local\CMakeTools\cmake-tools-kits.json
[proc] Executing command: C:\MinGW64\bin\gcc.exe -v
[main] Configuring folder: qttrial
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\MinGW64\bin\gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\MinGW64\bin\g++.exe -Sc:/Users/astro/Desktop/Git/qttrial -Bc:/Users/astro/Desktop/Git/qttrial/build -G "MinGW Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- The C compiler identification is GNU 8.1.0
[cmake] -- The CXX compiler identification is GNU 8.1.0
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: C:/MinGW64/bin/gcc.exe - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: C:/MinGW64/bin/g++.exe - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- Looking for pthread.h
[cmake] -- Looking for pthread.h - found
[cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
[cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
[cmake] -- Check if compiler accepts -pthread
[cmake] -- Check if compiler accepts -pthread - yes
[cmake] -- Found Threads: TRUE
[cmake] -- Performing Test HAVE_STDATOMIC
[cmake] -- Performing Test HAVE_STDATOMIC - Success
[cmake] -- Found WrapAtomic: TRUE
[cmake] -- Found WrapVulkanHeaders: C:/VulkanSDK/1.3.211.0/Include
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: C:/Users/astro/Desktop/Git/qttrial/build
[main] Building folder: qttrial trial
[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/Users/astro/Desktop/Git/qttrial/build --config Debug --target trial -j 14 --
[build] [ 25%] Automatic MOC and UIC for target trial
[build] [ 25%] Built target trial_autogen
[build] [ 50%] Building CXX object CMakeFiles/trial.dir/trial_autogen/mocs_compilation.cpp.obj
[build] [ 75%] Building CXX object CMakeFiles/trial.dir/main.cpp.obj
[build] [100%] Linking CXX executable trial.exe
[build] [100%] Built target trial
[build] Build finished with exit code 0
Terminal results:
PS C:\Users\astro\Desktop\Git\qttrial\build> ."C:/Users/astro/Desktop/Git/qttrial/build/trial.exe"
PS C:\Users\astro\Desktop\Git\qttrial\build>
I would be immensely grateful to anyone who can point me in a direction to solve this. Given that there are no error messages, I'm lost as to where to start. If any of you guys need any more information, I'll be happy to supply it. :)

In CLion: CMake was unable to find a build program corresponding to "Unix Makefiles"

I'm working in CLion with the full remote mode. I got an error when loading the cmake project:
/mnt/home/idmg/lhz/tool/cmake-3.17.5-Linux-x86_64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /mnt/home/idmg/lhz/CLionProjects/IOE-SORW
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/mnt/home/idmg/lhz/CLionProjects/IOE-SORW/cmake-build-debug-idmg/CMakeFiles/CMakeOutput.log".
[Failed to reload]
However, when I execute the command directly in the terminal, everything works fine:
$ /mnt/home/idmg/lhz/tool/cmake-3.17.5-Linux-x86_64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /mnt/home/idmg/lhz/CLionProjects/IOE-SORW
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/home/idmg/lhz/CLionProjects/IOE-SORW/cmake-build-debug-idmg
I'm confused about this, and thus this CMake profile is not shown in CLion. How can I fix this?
Have the same issue. As a workaround can suggest to generate cmake cache manually in terminal and then CLion can work with existed cache with CMAKE_MAKE_PROGRAM setted.
CLion 2021.1.1 full remote mode.
remote: ubuntu18.04 docker container

Windows not able to find FLEX_LIBRARIES

When using this CMakeLists.txt
cmake_minimum_required(VERSION 3.17)
project(project_c)
set(CMAKE_CXX_STANDARD 11)
set(project_name project_c)
find_package(BISON)
find_package(FLEX)
BISON_TARGET(parser parser.y ${CMAKE_SOURCE_DIR}/parser.cpp)
FLEX_TARGET(lexer lexer.l ${CMAKE_SOURCE_DIR}/lexer.cpp)
ADD_FLEX_BISON_DEPENDENCY(lexer parser)
add_executable(${project_name} ${BISON_parser_OUTPUTS} ${FLEX_lexer_OUTPUTS})
target_include_directories(${project_name} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_link_libraries(${project_name} ${FLEX_LIBRARIES})
CMake complains about
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FL_LIBRARY (ADVANCED)
linked by target "project_c" in directory D:/asant/workspace/CLionProjects/project_c
I've tried to copy the winflex folder inside the project folder but that won't help anyway. This proposed solution isn't working.
This is the complete CMake log
"C:\Program Files\JetBrains\CLion 2018.3.4\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" D:\asant\workspace\CLionProjects\project_c
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/Qt/Tools/mingw810_64/bin/gcc.exe
-- Check for working C compiler: C:/Qt/Tools/mingw810_64/bin/gcc.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Qt/Tools/mingw810_64/bin/g++.exe
-- Check for working CXX compiler: C:/Qt/Tools/mingw810_64/bin/g++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found BISON: C:/Program Files (x86)/win_flex_bison-2.5.23/win_bison.exe (found version "3.7.1")
-- Found FLEX: C:/Program Files (x86)/win_flex_bison-2.5.23/win_flex.exe (found version "2.6.4")
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FL_LIBRARY (ADVANCED)
linked by target "project_c" in directory D:/asant/workspace/CLionProjects/project_c
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
[Failed to reload]

Every call to configure_file fails on WSL: configure_file Problem configuring file

I've just built and installed cmake 3.16 on a fresh WSL install (Ubuntu18.04 LTS). I then created a default hello world project
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest$ tree .
.
├── CMakeLists.txt
└── main.cpp
//CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(ATest)
set(CMAKE_CXX_STANDARD 14)
add_executable(ATest main.cpp)
//main.cpp
#include <iostream>
#include <string>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
And then tried to build:
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest$ mkdir build
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest$ cd build/
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest/build$ cmake ..
And I get the following.
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:185 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- The C compiler identification is GNU 10.1.0
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake:212 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- The CXX compiler identification is GNU 10.1.0
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake:210 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:80 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:73 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/mnt/d/ATest/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/d/ATest/build/CMakeFiles/CMakeError.log".
(base) ciaran#DESKTOP-K0APGUV:/mnt/d/ATest/build$
I originally tried cmake 3.15 but upgraded to see if it was a version problem, given this, I don't this it is. I've also tried g++-7 and g++-9 which behave the same.
Does anybody know what might be going on here? Thanks.
Create a file named wsl.conf in /etc/ with the following text:
# /etc/wsl.conf
[automount]
options = "metadata"
enabled = true
Reboot wsl:
wsl.exe -t Ubuntu // (or other e.g. Debian)
Sources:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003413779-Troubles-with-WSL-toolchain-Test-CMake-run-finished-with-errors-
https://github.com/microsoft/WSL/issues/3994#issuecomment-507864837
https://learn.microsoft.com/en-us/windows/wsl/wsl-config