0
$\begingroup$

Rosanswers logo

While using catkin_make in the folder with CMakeLists.txt file, the following error was shown: What is the correct way to make a package while using ROS in Windows 10?

Visual Studio: Community Version

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
  The CMAKE_C_COMPILER:

    cl

  is not a full path and was not found in the PATH.

  To use the NMake generator with Visual C++, cmake must be run from a shell
  that can use the compiler cl from the command line.  This environment is
  unable to invoke the cl compiler.  To fix this problem, run cmake from the
  Visual Studio Command Prompt (vcvarsall.bat).

  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:

    cl

  is not a full path and was not found in the PATH.

  To use the NMake generator with Visual C++, cmake must be run from a shell
  that can use the compiler cl from the command line.  This environment is
  unable to invoke the cl compiler.  To fix this problem, run cmake from the
  Visual Studio Command Prompt (vcvarsall.bat).

  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.

Originally posted by Matt_Blanc on ROS Answers with karma: 11 on 2019-05-20

Post score: 1


Original comments

Comment by gvdhoorn on 2019-05-20:
Just checking: are you running this from the Visual Studio command prompt (ie: the shortcut you are instructed to create at the beginning of the installation instructions)?

If not, your environment hasn't been setup correctly leading to CMake/Catkin not being able to find the necessary tools (such as the compiler).

Comment by jalamani on 2019-07-23:
I get the same problem with the Administrative command line shortcut

~\catkin_ws>set ros
ROS_DISTRO=melodic
ROS_ETC_DIR=C:/opt/ros/melodic/x64/etc/ros
ROS_MASTER_URI=http://localhost:11311
ROS_PACKAGE_PATH=C:\opt\ros\melodic\x64\share
ROS_PYTHON_VERSION=2
ROS_ROOT=C:/opt/ros/melodic/x64/share/ros
ROS_VERSION=1

shows that I have the correct environment variables.

Comment by Sean Yen on 2019-09-30:
@jalamani @Matt_Blanc, have you run the Visual Studio developer command prompt as the Wiki page described? Also you will need to make sure your Desktop development with C++ is installed along with your Visual Studio 2019 (see here for information).

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I ran into the same problem, and I realized what our problem may have been @Matt_Blanc. VS upgraded to 2019 and the tutorial's administrator command line shortcut asks to put 2017 instead of 2019. So if you were on autopilot like me, you would've been opening the regular command line instead of VS's.


Originally posted by jalamani with karma: 26 on 2019-07-24

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.