How do I use the MSVisualStudio 64bit compiler?

asked 2019-09-30 11:24:02 -0600

Marcel Usai gravatar image

Hi, I installed ROS melodic on windows 10 and try to compile a ROS package that I successfully used on ubuntu. I use Visual Studio 2015 but if it helps, I would switch to 2017 or 2019.

When I use catkin_make to build, the linker fails with the following error:

roscpp.lib(roscpp.dll) : fatal error LNK1112: Modul-Computertyp "x64" steht in Konflikt mit dem Zielcomputertyp "X86".
NMAKE : fatal error U1077: "C:\opt\rosdeps\x64\bin\cmake.exe": Rückgabe-Code "0xffffffff"
Stop.
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"": Rückgabe-Code "0x2"
Stop.
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"": Rückgabe-Code "0x2"
Stop.
Invoking "nmake" failed

This seems like I want to compile for x86 but the libraries are compiled for x64. As I run a 64bit machine and dlls for ROS and Qt are pre-compiled for x64, is there any way to use the x64 compiler of visual studio? I tried to run the command promt with following targets, but failed.

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

Fails with The command "C:\Program" is either written wrong or could not be found.

C:\Windows\System32\cmd.exe /k "C:\PROGRA~1\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 && c:\opt\ros\melodic\x64\setup.bat

Fails with The command "C:\Program" is either written wrong or could not be found.

C:\Windows\System32\cmd.exe /k "%ProgramFiles%\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 && c:\opt\ros\melodic\x64\setup.bat

Fails with The command "C:\Program" is either written wrong or could not be found.

And as I run a German system: C:\Windows\System32\cmd.exe /k "C:\Programme\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 && c:\opt\ros\melodic\x64\setup.bat

Fails with Access Denied.

How do I get to use the visual studio compiler for x64 target systems with catkin_make?

Or, if only that is possible, how do I get x86 ros (and qt) libraries to be able to link?

Or maybe I am missing something completely different?

Thank you in advance!

edit retag flag offensive close merge delete

Comments

Which installation and setup tutorial did you follow for installing ROS on Windows 10? This one?

gvdhoorn gravatar imagegvdhoorn ( 2019-09-30 15:07:31 -0600 )edit

Yes, it was this one.

Marcel Usai gravatar imageMarcel Usai ( 2019-09-30 16:40:39 -0600 )edit