[英]CMake; 386:x86-64 architecture of input file (.. ) is incompatible with i386 output
I get this error when first doing 'cmake build' and then 'make':我在第一次执行“cmake build”然后执行“make”时收到此错误:
/usr/bin/ld: i386:x86-64 architecture of input file `CMakeFiles/eperftool.dir/mp4reader.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `CMakeFiles/eperftool.dir/codec_instance_mgmt.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `CMakeFiles/eperftool.dir/callbacks.o' is incompatible with i386 output
(...)"
This is the format of my make-file:这是我的生成文件的格式:
file (GLOB eperftool_sources ./*)
set(EPERFTOOL_BIN ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}/eperftool CACHE STRING "eperftool dir")
add_executable( eperftool ${eperftool_sources})
find_package (Threads)
if (Threads_FOUND)
include_directories(${Threads_INCLUDE_DIRS})
endif (Threads_FOUND)
target_link_libraries(eperftool openfec m)
target_link_libraries(eperftool ${CMAKE_THREAD_LIBS_INIT} )
set(CMAKE_SHARED_LINKER_FLAGS "-m32")"
I added the final line 'set(CMAKE_SHARED_LINKER_FLAGS "-m32")' after Googling the problem and finding a person that has added the linker-flag '-m32' in order to solve it, but it didn't solve the problem for me.在谷歌搜索问题并找到一个添加了链接器标志“-m32”以解决它的人之后,我添加了最后一行“set(CMAKE_SHARED_LINKER_FLAGS“-m32”)”,但它并没有为我解决问题.
What should I do in order to solve the problem?我应该怎么做才能解决这个问题?
Thanks!谢谢!
I think, you copied the object files mp4reader.o, codec_instance_mgmt.o and callbacks.o
from somewhere (not compiled on your system), which is causing incompatibility on your system.我认为,您从某处(未在您的系统上编译)复制了 object 文件
mp4reader.o, codec_instance_mgmt.o and callbacks.o
,这导致您的系统不兼容。 You can try to remove all objects and compile it again:您可以尝试删除所有对象并重新编译:
rm *.o
and then compile again.然后再次编译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.