I get this error when first doing ‘cmake build’ and then ‘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.
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.ofrom somewhere (not compiled on your system), which is causing incompatibility on your system.You can try to remove all objects and compile it again:
and then compile again.