Ask Your Question
1

How to make package using ROS on Windows ?

asked 2019-05-20 01:56:53 -0500

Matt_Blanc gravatar image

updated 2019-05-20 02:11:19 -0500

gvdhoorn gravatar image

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.
edit retag flag offensive close merge delete

Comments

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).

gvdhoorn gravatar imagegvdhoorn ( 2019-05-20 02:12:40 -0500 )edit

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.

jalamani gravatar imagejalamani ( 2019-07-23 23:30:55 -0500 )edit

@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).

Sean Yen gravatar imageSean Yen ( 2019-09-30 14:03:28 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-05-21 18:10:23 -0500

OoeyGUI gravatar image

updated 2019-07-24 13:15:00 -0500

jayess gravatar image

Thanks @gvdhoorn.

@Matt_Blanc, For your configuration you'll want to launch an administrator command prompt with the VStool environment. The best way to do this is to create a shortcut with the following command line:

C:\Windows\System32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 && c:\opt\ros\melodic\x64\setup.bat

Then right click, select properties, advanced, then Run as Administrator.

This shortcut will load the Visual Studio command line environment and the ROS environment.

Lou

edit flag offensive delete link more

Comments

does this call the 32bit or 64bit compiler?

Marcel Usai gravatar imageMarcel Usai ( 2019-09-30 11:01:38 -0500 )edit
0

answered 2019-07-24 07:08:11 -0500

jalamani gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-05-20 01:56:53 -0500

Seen: 1,188 times

Last updated: Jul 24