CMake; 386: x86-64 input file architecture (..) is incompatible with i386 output
I get this error when I do 'cmake build' first 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 my makefile format:
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 found the person who added the -link flag -m32 to fix the problem, but that didn't fix the problem for me.
What should I do to fix the problem?
Thank!
+3
source to share