我先执行“ 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
(...)"
这是我的制作文件的格式:
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")"
我在谷歌搜索问题后添加了最后一行'set(CMAKE_SHARED_LINKER_FLAGS“ -m32”)',并找到一个添加了链接标志'-m32'的人来解决它,但它并没有解决我的问题。
为了解决这个问题我该怎么办?
谢谢!
最佳答案
我认为,您是从某个位置(未在系统上编译的)复制了目标文件mp4reader.o, codec_instance_mgmt.o and callbacks.o
,这会导致系统不兼容。
您可以尝试删除所有对象并再次编译:
rm *.o
然后再次编译。