/usr/bin/ld: i386 architecture of input file `xx‘ is incompatible with i386:x86-64 output
Cmake解决办法:
add_compile_options(-m32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -m32")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -m32")
原报错:
CMakeFiles/test_time_cache.dir/test_time_cache.cc.o: In function `main':
/mnt/hgfs/main_work/temp_test/cpp_test/test_time_cache.cc:367: undefined reference to `operator new(unsigned int)'
CMakeFiles/test_time_cache.dir/test_time_cache.cc.o: In function `std::chrono::duration<long long, std::ratio<1ll, 1ll> > std::chrono::__duration_cast_impl<std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::ratio<1ll, 1000000ll>, long long, true, false>::__cast<long long, std::ratio<1ll, 1000000ll> >(std::chrono::duration<long long, std::ratio<1ll, 1000000ll> > const&)':
/usr/include/c++/4.8.2/chrono:162: undefined reference to `__divdi3'
CMakeFiles/test_time_cache.dir/test_time_cache.cc.o: In function `void std::this_thread::sleep_for<long long, std::ratio<1ll, 1000000ll> >(std::chrono::duration<long long, std::ratio<1ll, 1000000ll> > const&)':
/usr/include/c++/4.8.2/thread:281: undefined reference to `std::this_thread::__sleep_for(std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >)'
CMakeFiles/test_time_cache.dir/test_time_cache.cc.o: In function `std::chrono::duration<long long, std::ratio<1ll, 1ll> > std::chrono::__duration_cast_impl<std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::ratio<1ll, 1000ll>, long long, true, false>::__cast<long long, std::ratio<1ll, 1000ll> >(std::chrono::duration<long long, std::ratio<1ll, 1000ll> > const&)':
/usr/include/c++/4.8.2/chrono:162: undefined reference to `__divdi3'
CMakeFiles/test_time_cache.dir/test_time_cache.cc.o: In function `void std::this_thread::sleep_for<long long, std::ratio<1ll, 1000ll> >(std::chrono::duration<long long, std::ratio<1ll, 1000ll> > const&)':
/usr/include/c++/4.8.2/thread:281: undefined reference to `std::this_thread::__sleep_for(std::chrono::duration<long long, std::ratio<1ll, 1ll> >, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> >)'
CMakeFiles/test_time_cache.dir/test_time_cache.cc.o: In function `__gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<std::thread::_Impl<std::_Bind_simple<void (*())()> >, std::allocator<std::thread::_Impl<std::_Bind_simple<void (*())()> > >, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned int, void const*)':
/usr/include/c++/4.8.2/ext/new_allocator.h:104: undefined reference to `operator new(unsigned int)'
/usr/bin/ld: i386 architecture of input file `xx‘ is incompatible with i386:x86-64 output相关推荐
- usr/bin/ld: i386 architecture of input file XXX.a( xxx.o) is incompatible with i386:x86-64
问题:usr/bin/ld: i386 architecture of input file XXX.a( xxx.o) is incompatible with i386:x86-64 output ...
- ld: i386 architecture of input file `kernel.o‘ is incompatible with i386:x86-64 output
学习操作系统时,链接几个用nasm汇编器生成的elf文件时,出现如题所示的错误提示. 操作如下: nasm -f elf kernel.asm -o kernel.o nasm -f elf stri ...
- ld: i386 architecture of input file `eatsyscall.o' is incompatible with i386:x86-64 output
在Ubuntu下用学习汇编语言编程,在使用ld链接时有碰到标题所示的问题. 很明显,root cause 是我编译好的文件(eatsyscall.o)是遵循i386 architecture, 而我使 ...
- ld: i386 architecture of input file is incompatible with i386:x86-64 output
如果报以上错误,可以使用下面的语句来解决: If want compile the file as 32 bits, you can use: ld -m elf_i386 -s -o file fi ...
- Qt error: /usr/bin/ld: cannot find -lGL: No such file or directory
QtCreator报错: clang++ -ccc-gcc-name g++ -Wl,-rpath,/home/yigo/Qt5.12.12/5.12.12/gcc_64/lib -o Test1 m ...
- make报错:/usr/bin/ld: cannot find -lXXX
在编译php时报错如下: # make ... /usr/bin/ld: cannot find -lltdl collect2: ld returned 1 exit status make: ** ...
- /usr/bin/ld: cannot find -lfontconfig解决方法
有时候我们编译php的时候会出现以下问题: /usr/bin/ld: cannot find -lfontconfig collect2: ld returned 1 exit status make ...
- /usr/bin/ld: skipping incompatible -转
今天碰到的问题: /usr/bin/ld: skipping incompatible qt在连接a和so文件时报错 分析:编译器给出的错误信息已经很清楚了:兼容性问题 解决方法: file xxx. ...
- usr / bin / ld:找不到-l <nameOfTheLibrary>
本文翻译自:usr/bin/ld: cannot find -l I'm trying to compile my program and it returns this error : 我正在尝试编 ...
最新文章
- dice系数 交叉熵_语义分割中的损失函数
- emulator: ERROR: x86 emulation currently requires hardware acceleration!
- 分布式入门:常用的分布式基础算法
- how to create BRF application via code
- PHP独特学习模式_php基础知识
- java 静态导入_Java中静态导入的使用
- 图像形状特征(四)--轮廓树及PGH
- python获取淘宝服务器时间的代码
- 配置安装跟踪服务器Tracker 配置FastDFS存储服务器 Storage
- Chrome浏览器书签同步配置方法
- 【经典】产品人面试中的一些软回答~~
- Adobe Audition 2022 v22.2 U2B macOS 专业的音频工作站
- agx上搭建ros2
- QT编写简易的SSL证书注册工具
- 嵌入式开发对学历门槛要求高吗?
- zabbix学习笔记——入门篇
- 独立站运营技巧:如何引流?如何提高转化率
- 工程安装与部署中处理环境变量的最佳实践
- np.corrcoef相关系数计算
- mysql icp_试释MySQL ICP的部分疑点