简体   繁体   English

CMake; 386:x86-64 输入文件架构 (..) 与 i386 不兼容 output

[英]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.

相关问题 链接问题:i386:x86-64输入文件架构* .o与i386输出不兼容 - linking problem: i386:x86-64 architecture of input file *.o is incompatible with i386 output GCC:输入文件“ ../window.ui.o”的i386体系结构与i386:x86-64输出不兼容 - GCC: i386 architecture of input file `../window.ui.o' is incompatible with i386:x86-64 output c ) 出错和链接问题:输入文件的 i386:x86-64 架构,与 i386 不兼容 output - c )make error& link problem: i386:x86-64 architecture of input file, incompatible with i386 output 文件是为i386构建的,而不是在Mac OSX 10.6上为iOS 4.2编译OpenCV2.2时所链接的架构(x86_64) - file was built for i386 which is not the architecture being linked (x86_64) while compiling OpenCV2.2 for iOS 4.2 on Mac OSX 10.6 从i386移动到x86_64时的浮点精度 - Floating-point precision when moving from i386 to x86_64 C sscanf i386 与 x86_64 解析引用字符串的不同行为 - C different behavior of sscanf i386 vs x86_64 parsing quoted string timer_create在i386系统上导致分段错误,但在x86_64系统上未引起分段错误(linux) - timer_create causing segmentation fault on i386 system, but not x86_64 system(linux) GNU链接器和体系结构i386 - GNU Linker and architecture i386 为i386编译x264 - Compiling x264 for i386 OS X - 在C中使用内联汇编时,架构i386的未定义符号 - OS X - undefined symbols for architecture i386 when using inline assembly in C
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM