1

I have checked different questions regarding the x64 and x86 conflict but none of them applies to my case: I am creating a package called beginner_tutorials in my catkin_ws. Inside my package I introduce several files in the src folder. Then, when executing catkin_make I get the following:

LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1425~1.286\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\listener.dir\objects1.rsp /out:C:\Users\Hector\Desktop\Projects\ROSProject\catkin_ws\devel\lib\beginner_tutorials\listener.exe /implib:C:\Users\Hector\Desktop\Projects\ROSProject\catkin_ws\devel\lib\listener.lib /pdb:C:\Users\Hector\Desktop\Projects\ROSProject\catkin_ws\devel\lib\beginner_tutorials\listener.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console C:\opt\ros\melodic\x64\lib\roscpp.lib C:\opt\rosdeps\x64\lib\boost_filesystem-vc141-mt-x64-1_66.lib C:\opt\ros\melodic\x64\lib\rosconsole.lib C:\opt\ros\melodic\x64\lib\rosconsole_log4cxx.lib C:\opt\ros\melodic\x64\lib\rosconsole_backend_interface.lib C:\opt\rosdeps\x64\lib\log4cxx.lib C:\opt\rosdeps\x64\lib\boost_regex-vc141-mt-x64-1_66.lib C:\opt\ros\melodic\x64\lib\xmlrpcpp.lib C:\opt\ros\melodic\x64\lib\roscpp_serialization.lib C:\opt\ros\melodic\x64\lib\rostime.lib C:\opt\ros\melodic\x64\lib\cpp_common.lib C:\opt\rosdeps\x64\lib\boost_system-vc141-mt-x64-1_66.lib C:\opt\rosdeps\x64\lib\boost_thread-vc141-mt-x64-1_66.lib C:\opt\rosdeps\x64\lib\boost_chrono-vc141-mt-x64-1_66.lib C:\opt\rosdeps\x64\lib\boost_date_time-vc141-mt-x64-1_66.lib C:\opt\rosdeps\x64\lib\boost_atomic-vc141-mt-x64-1_66.lib C:\opt\rosdeps\x64\lib\console_bridge.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\listener.dir/intermediate.manifest CMakeFiles\listener.dir/manifest.res" failed (exit code 1112) with the following output:

My catkin_ws structure looks like:

catkin_ws
--build
--devel
--src
----CMakeLists
----beginner_tutorials
------msg
------src
------CMakeList
------package.xml

My CMakeLists inside beginner_tutorials looks like:

# %Tag(FULLTEXT)%
cmake_minimum_required(VERSION 2.8.3)
project(beginner_tutorials)

## Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation)

## Declare ROS messages and services
add_message_files(DIRECTORY msg FILES Num.msg)

## Generate added messages and services
generate_messages(DEPENDENCIES std_msgs)

## Declare a catkin package
catkin_package()

include_directories(${catkin_INCLUDE_DIRS})

# %EndTag(FULLTEXT)%
add_executable(talker src/talker.cpp)
target_link_libraries(talker ${catkin_LIBRARIES})
add_executable(points_and_lines src/print_points.cpp)
target_link_libraries(points_and_lines ${catkin_LIBRARIES})
add_dependencies(talker beginner_tutorials_generate_messages_cpp)

add_executable(listener src/listener.cpp)
target_link_libraries(listener ${catkin_LIBRARIES})
add_dependencies(listener beginner_tutorials_generate_messages_cpp)

I do not see where I can set anything regarding x86

Hector Esteban
  • 1,011
  • 1
  • 14
  • 29

1 Answers1

1

For some reason, catkin_make generated build files for the X86 (32 bit) architecture of Visual Studio (note the /machine:X86 option and that ...\bin\Hostx86\x86\link.exe is invoked), which is why you get the link conflict with the X64 (64 bit) ROS libraries.

I can't tell you why, but I can give you a few ideas where to look and maybe find the solution for yourself.

  • Did you install the X64 version of Visual Studio and MSVC?
  • Did you follow the recommended procedures of the ROS Windows installation guide?
  • You could try and force a X64 build with catkin_make --cmake-args -A X64, does that help? If not, do you get a different error message that points towards a missing compiler or linker?

Good look in your bug hunt.

Paralogos
  • 51
  • 3