0
votes

I'm trying to compile a C++ program using WSL in Windows10/Ubuntu/VS2019. When I try to build the program I'm getting following errors.

CMake generation started for configuration: 'WSL-GCC-Debug'.

Found cmake executable at $HOME/.vs/cmake/bin/cmake.

$HOME/.vs/cmake/bin/cmake -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="/mnt/d/Work/j/install/" /mnt/d/Work/j/CMakeLists.txt;

[CMake] CMake Error at /home/s/.vs/cmake/share/cmake-3.18/Modules/CMakeDetermineSystem.cmake:185 (configure_file):

[CMake] configure_file Problem configuring file

[CMake] Call Stack (most recent call first):

[CMake] CMakeLists.txt:8 (project)

[CMake] -- The C compiler identification is GNU 9.3.0

[CMake] CMake Error at /home/s/.vs/cmake/share/cmake-3.18/Modules/CMakeDetermineCCompiler.cmake:222 (configure_file):

[CMake] configure_file Problem configuring file

[CMake] Call Stack (most recent call first):

[CMake] CMakeLists.txt:8 (project)

[CMake] -- The CXX compiler identification is GNU 9.3.0

[CMake] CMake Error at /home/s/.vs/cmake/share/cmake-3.18/Modules/CMakeDetermineCXXCompiler.cmake:220 (configure_file):

[CMake] configure_file Problem configuring file

[CMake] Call Stack (most recent call first):

[CMake] CMakeLists.txt:8 (project)

[CMake] -- Detecting C compiler ABI info

[CMake] -- Detecting C compiler ABI info - failed

[CMake] -- Check for working C compiler: /usr/bin/cc

[CMake] -- Check for working C compiler: /usr/bin/cc - works

[CMake] -- Detecting C compile features

[CMake] -- Detecting C compile features - done

[CMake] CMake Error at /home/s/.vs/cmake/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:8 (project)

[CMake] -- Detecting CXX compiler ABI info

[CMake] -- Detecting CXX compiler ABI info - failed

[CMake] -- Check for working CXX compiler: /usr/bin/c++

[CMake] -- Check for working CXX compiler: /usr/bin/c++ - works

[CMake] -- Detecting CXX compile features

[CMake] -- Detecting CXX compile features - done

[CMake] CMake Error at /home/s/.vs/cmake/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:8 (project)

[CMake] -- Configuring incomplete, errors occurred!

[CMake] See also "/mnt/d/Work/j/build/CMakeFiles/CMakeOutput.log".

[CMake] See also "/mnt/d/Work/j/build/CMakeFiles/CMakeError.log".

[CMake]

cd /mnt/d/Work/j/build;$HOME/.vs/cmake/bin/cmake -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="/mnt/d/Work/j/install/" /mnt/d/Work/j 2>&1; returned with exit code: 1

I'm using following Build Configuration.

{
  "name": "WSL-GCC-Debug",
  "generator": "Ninja",
  "configurationType": "Debug",
  "buildRoot": "${projectDir}\\build\\",
  "installRoot": "${projectDir}\\install\\",
  "cmakeExecutable": "cmake",
  "cmakeCommandArgs": "",
  "buildCommandArgs": "",
  "ctestCommandArgs": "",
  "inheritEnvironments": [ "linux_x64" ],
  "wslPath": "${defaultWSLPath}",
  "addressSanitizerRuntimeFlags": "detect_leaks=0",
  "variables": [],
  "intelliSenseMode": "linux-gcc-x64"
}

Can anyone help with this?

1

1 Answers

0
votes

Ok. I was missing zip tool from WSL.

sudo apt install g++ gdb make rsync zip

Installing the command fixed it