我检查了关于x64和x86冲突的不同问题,但这些问题都不适用于我的情况:我正在catkin_ws
中创建一个名为beginner_tutorials
的包。在我的包中,我介绍了src
文件夹中的几个文件。然后,当执行catkin_make
时,我得到以下内容:
LINK Pass 1: command "C:PROGRA~2MICROS~12019COMMUN~1VCToolsMSVC1425~1.286binHostx86x86link.exe /nologo @CMakeFileslistener.dirobjects1.rsp /out:C:UsersHectorDesktopProjectsROSProjectcatkin_wsdevellibbeginner_tutorialslistener.exe /implib:C:UsersHectorDesktopProjectsROSProjectcatkin_wsdevelliblistener.lib /pdb:C:UsersHectorDesktopProjectsROSProjectcatkin_wsdevellibbeginner_tutorialslistener.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console C:optrosmelodicx64libroscpp.lib C:optrosdepsx64libboost_filesystem-vc141-mt-x64-1_66.lib C:optrosmelodicx64librosconsole.lib C:optrosmelodicx64librosconsole_log4cxx.lib C:optrosmelodicx64librosconsole_backend_interface.lib C:optrosdepsx64liblog4cxx.lib C:optrosdepsx64libboost_regex-vc141-mt-x64-1_66.lib C:optrosmelodicx64libxmlrpcpp.lib C:optrosmelodicx64libroscpp_serialization.lib C:optrosmelodicx64librostime.lib C:optrosmelodicx64libcpp_common.lib C:optrosdepsx64libboost_system-vc141-mt-x64-1_66.lib C:optrosdepsx64libboost_thread-vc141-mt-x64-1_66.lib C:optrosdepsx64libboost_chrono-vc141-mt-x64-1_66.lib C:optrosdepsx64libboost_date_time-vc141-mt-x64-1_66.lib C:optrosdepsx64libboost_atomic-vc141-mt-x64-1_66.lib C:optrosdepsx64libconsole_bridge.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFileslistener.dir/intermediate.manifest CMakeFileslistener.dir/manifest.res" failed (exit code 1112) with the following output:
我的catkin_ws
结构看起来像:
catkin_ws
--build
--devel
--src
----CMakeLists
----beginner_tutorials
------msg
------src
------CMakeList
------package.xml
我的CMakeLists
在beginner_tutorials
中看起来像:
# %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)
我看不出在哪里可以设置任何关于x86
的内容
由于某些原因,catkin_make
为Visual Studio的X86(32位(体系结构生成了构建文件(注意/machine:X86
选项和调用...binHostx86x86link.exe
(,这就是为什么您会与X64(64位(ROS库发生链接冲突的原因。
我不能告诉你为什么,但我可以给你一些想法,看看哪里,也许可以为自己找到解决方案。
- 是否安装了Visual Studio和MSVC的X64版本
- 您是否遵循了ROS Windows安装指南中推荐的程序
- 您可以尝试强制使用
catkin_make --cmake-args -A X64
构建X64,这有帮助吗?如果没有,是否会收到另一条错误消息,指向丢失的编译器或链接器
在你的bug搜寻中看起来不错。