热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

clang编译优化,为什么不用clang编译

Ikeepgettingld:librarynotfoundfor-lchaiscript_stdlib-5.3.1.soclang:error:linker


I keep getting


LD : librarynotfoundfor-lchaiscript _ stdlib-5.3.1.so


clang : error : linkercommandfailedwithexitcode1(use-vtoseeinvocation )。


When trying to link to a .so


The command I'm using is。


clang main.CPP-ofoo-l.//- lchaiscript _ stdlib-5.3.1.so


What am I doing wrong?


libchaiscript _ stdlib-5.3.1.soisinthesamedirectoryasmain.cppithoughtthe-l./wouldaddthe.sothelibraryseachphpthe


解决方案


yes the-loptionaddsthesearchpath,buttheLinkeraddsthe.so(or.a ) suffixItself ) justlikeitaddsthelibprefix ).soyouonlon


youcanalsoskiptheaddingofthepath,andlinkdirectlywiththefile :


clang main.CPP-ofoolibchaiscript _ stdlib-5.3.1.so


notethattheruntimelinker (whichiswhatactuallyloadsthesharedlibrarieswhenyourunyourprogram )。 mightnotbeabletofindthelibraryifit ' snotintheruntimelinkerspath.youcantellthe (compile time ) linkertoadddapathtothesheshared -。


clang main.CPP-ofoolibchaiscript _ stdlib-5.3.1.so-wl,-rpath,/absolute/path


the-wloptiontellsthecompilerfront-endtopassanoptiontothelinker,andthelinkeroption-rpathaddsapathtotheruntime-linker shelinker


推荐阅读
  • 篇首语:本文由编程笔记#小编为大家整理,主要介绍了在单独的JVM上执行新的JavaFX应用程序相关的知识,希望对你有一定的参考价值。 ... [详细]
  • C#|类型。GetTypeHandle()方法原文:https ... [详细]
  • Android性能优化检测App卡顿
    在移动APP性能评测-流畅度评测中,我们介绍了如何准确客观评价APP的流畅度,最终采用SM指标来评价应用的流畅度,在知道如何评价流畅度之后 ... [详细]
  • 接口自动化相关面试题
    你好,我是懂Java的测试最近辅导简历,有同学向我反馈,自学过接口自动化、没有落地接口自动化项目办?还有很多同学落地实践过自 ... [详细]
  • NSSROUND#8[Basic]
    文章目录一、[NSSRound#8Basic]MyDoor二、[NSSRound#8Basic]Upload_gogoggo三、[NSSRound#8Basic]MyPage四、[ ... [详细]
  • 使用Java调用exe可执行文件
    一、出发点平日里,我们看到了很多已经成型的可执行文件,而且经过了一定的封装。因为开源的关系,大多时候可以自己使用eclipse进行编译&# ... [详细]
  • LwIP系列内存管理(堆内存)详解
    一、目的小型嵌入式系统中的内存资源(SRAM)一般都比较有限,LwIP的运行平台一般都是资源受限的MCU。为了能够更加高效的运行ÿ ... [详细]
  • 1.File类:文件和目录路径名的抽象表现形式2.创建对象:File(Stringpathname)通过给定的路径创建文件对象File(Stringpa ... [详细]
  • FroggerTimeLimit:1000MSMemoryLimit:65536KTotalSubmissions:32257Accepted:10396DescriptionFr ... [详细]
  • 九宫格计算. ... [详细]
  • 22.Container With Most Water(能装最多水的容器)
    thecontainercontainsthemos ... [详细]
  • PIMPL 是 C++ 中的一个编程技巧,意思为指向实现的指针。具体操作是把类的实现细节放到一个单独的类中,并用一个指针进行访问 ... [详细]
  • 互联网世界 9 种基本的商业模式
    互联网世界9种基本的商业模式一个商业模式是运行一个公司的方法;通过该模式的运作,一个公司能维持自己的生存,就是说,能有收益。商业模式意味着一个公司是如何通过在价值链中定位自己,从而获 ... [详细]
  • 1.方法一:采用OleDB读取EXCEL文件:把EXCEL文件当做一个数据源来进行数据的读取操作,实例如下:publicDa ... [详细]
  • ld:frameworknotfoundParseclang:error:linkercommandfailedwithexitcode1(use-vtoseeinvocatio ... [详细]
author-avatar
孤l叶_991
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有