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相关推荐

  1. 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 ...

  2. 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 ...

  3. ld: i386 architecture of input file `eatsyscall.o' is incompatible with i386:x86-64 output

    在Ubuntu下用学习汇编语言编程,在使用ld链接时有碰到标题所示的问题. 很明显,root cause 是我编译好的文件(eatsyscall.o)是遵循i386 architecture, 而我使 ...

  4. 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 ...

  5. 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 ...

  6. make报错:/usr/bin/ld: cannot find -lXXX

    在编译php时报错如下: # make ... /usr/bin/ld: cannot find -lltdl collect2: ld returned 1 exit status make: ** ...

  7. /usr/bin/ld: cannot find -lfontconfig解决方法

    有时候我们编译php的时候会出现以下问题: /usr/bin/ld: cannot find -lfontconfig collect2: ld returned 1 exit status make ...

  8. /usr/bin/ld: skipping incompatible -转

    今天碰到的问题: /usr/bin/ld: skipping incompatible qt在连接a和so文件时报错 分析:编译器给出的错误信息已经很清楚了:兼容性问题 解决方法: file xxx. ...

  9. usr / bin / ld:找不到-l <nameOfTheLibrary>

    本文翻译自:usr/bin/ld: cannot find -l I'm trying to compile my program and it returns this error : 我正在尝试编 ...

最新文章

  1. dice系数 交叉熵_语义分割中的损失函数
  2. emulator: ERROR: x86 emulation currently requires hardware acceleration!
  3. 分布式入门:常用的分布式基础算法
  4. how to create BRF application via code
  5. PHP独特学习模式_php基础知识
  6. java 静态导入_Java中静态导入的使用
  7. 图像形状特征(四)--轮廓树及PGH
  8. python获取淘宝服务器时间的代码
  9. 配置安装跟踪服务器Tracker 配置FastDFS存储服务器 Storage
  10. Chrome浏览器书签同步配置方法
  11. 【经典】产品人面试中的一些软回答~~
  12. Adobe Audition 2022 v22.2 U2B macOS 专业的音频工作站
  13. agx上搭建ros2
  14. QT编写简易的SSL证书注册工具
  15. 嵌入式开发对学历门槛要求高吗?
  16. zabbix学习笔记——入门篇
  17. 独立站运营技巧:如何引流?如何提高转化率
  18. 工程安装与部署中处理环境变量的最佳实践
  19. np.corrcoef相关系数计算
  20. mysql icp_试释MySQL ICP的部分疑点

热门文章

  1. mtk7687芯片资料下载
  2. C++实现矩阵计算器
  3. 基于WIN32汇编实现的仿Windows计算器
  4. 如何用PDF阅读器实现PDF旋转
  5. 511遇见易语言API模块视频教程取所有子窗口句柄
  6. h5中使用C语言sdk开发包,腾讯社交联盟广告
  7. 制作安装包遇到的问题安装netframewo
  8. 两大世界在线查毒网站 VirusTotal 和 VirSCAN
  9. 虚拟机文件无法正常打开的解决方法
  10. 计算机讲座背景图,【直播】 以计算机图形研究视角一窥荧幕背后的魔法,讲座即将开始...