- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在复制粘贴 section来自 ld
的人:-
-u symbol
--undefined=symbol
Force symbol to be entered in the output file as an undefined symbol. Doing this
may,for example, trigger linking of additional modules from standard libraries.
`-u' may be repeated with different option arguments to enter additional
undefined symbols.
如何实际使用这个选项?至于我如何在我的源代码中触发附加模块的链接,这个选项什么时候真正有用?
最佳答案
它对于从您的代码中未引用的静态库中提取目标文件很有用。与静态库链接时,链接器仅使用其中满足 undefined symbol 的对象。
此选项没有很多实际用例。通常没有必要链接一个未被引用的对象。据推测,如果它有用,它会在某处被引用。因此,将它包括在内肯定会有一些奇怪的副作用。
我能给你的唯一真实示例是在 Windows 下使用 Microsoft 链接器的类似选项。我想将 DirectX 错误消息库 (DXERR.LIB) 转换为 DLL,因此我使用了类似于以下的命令:
link /machine:ix86 /dll /out:dxerr.dll /base:0x400000
/include:_DXGetErrorStringA@4 /export:_DXGetErrorStringA@4
/include:_DXGetErrorStringW@4 /export:_DXGetErrorStringW@4
dxerr.lib mscvrt.lib user32.lib kernel32.lib
/include
开关相当于 ld 的 -u
选项。如果我不使用这些开关,我会得到一个空的 DLL,其中没有任何函数导出。
关于c++ - ld 的 -u 选项如何工作以及何时有用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24834042/
当我开始学习一门新语言时,我总是觉得我没有以实用、标准的方式进行学习。所以这里有一个关于 jQuery 的问题以及我所做的是否可以接受。 我有 3 张图片。 然后我让 jQuery 检测 $('
基本上,我想知道线程是否有用或必要,或者可能更具体地说,您将使用它的用途和情况。我对线程了解不多,也从未使用过它(我主要使用 C#),并且想知道如果使用它们是否会提高性能或稳定性。如果有人愿意解释一下
这个问题在这里已经有了答案: What is The Rule of Three? (8 个答案) 关闭 7 年前。 嘿嘿。我有一个让我很难过的问题。我自定义了一个普通的拷贝构造函数但它只在我初始化
这个问题在这里已经有了答案: 关闭 12 年前。 Possible Duplicate: Uses for multiple levels of pointer dereferences? 我在 C
我不确定异常在每种语言中的工作方式是否相同,但我使用的是 PHP,我想知道我什么时候做这样的事情: if (!$this->connection[0]->query($this->query)) t
Scala native 是最近发布的,但是他们(现在)使用的垃圾收集器非常rudimentary,因此不适合严肃使用。 所以我想知道:为什么不只将Scala转换为Go (即Scala.js)?这将是
最近,我一直在研究docker及其对SaaS公司的有用性。我花了一些时间学习如何容器化应用程序,并简要了解了什么是docker和容器。我在理解这项技术的实用性时遇到了一些问题。我看过dockercon
我必须根据出现在它们之前的字符串是否是某个关键字“load”从输入文件中读取整数。没有关键数字告诉我们要输入多少个数字。这些数字必须保存到一个数组中。为了避免为扫描的每个附加数字创建和更新新数组,我想
Deferred 对象具有回调池 doneCallbacks、failCallbacks 和 progressCallbacks。 doneCallbacks 和 failCallbacks(以及方法
这个问题在这里已经有了答案: Is there a case where including the same header twice is actually helpful? (6 个答案) 关
我在C++ Programming Language的书上看到了下面的例子 class Ptr { X* operator->( ); }; voide f(Ptr p) { p-
你能不能: template const T &operator[] (unsigned int x) 我的想法是如果你有一个 map如果有一个包装器类可以让您这样做,那就太好了: obj["Int
根据doc这个tutorial , cmp() returns -1 if x y 教程里也说了 cmp() returns the sign of the difference of two nu
我经常读到 It seem that identity monad is useless. It's not... but that's another topic. 那么谁能告诉我它有什么用? 最佳
我已经知道实现和接口(interface)的基础知识。我不明白什么时候使用接口(interface)。有接口(interface)的要求是什么? 例子: /// Interface demo Inte
在一些 R 函数的主体中,例如 lm,我看到对 match.call 函数的调用。正如其帮助页面所述,当在函数内部使用 match.call 时,会返回指定参数名称的调用;这对于将大量参数传递给另一个
在监督学习中,我有典型的训练/测试分割来学习算法,例如回归或分类。关于无监督学习,我的问题是:训练/测试分割是否必要且有用?如果是,为什么? 最佳答案 这取决于问题、数据集的形式以及用于解决特定问题的
我最近接触到 Javascript 模板并变得非常感兴趣。 我正在使用 MVC 模式构建一个大型 PHP 应用程序。模板由相当棒的 Twig 处理. 我最近遇到了一个 javascript imple
我最近在一个我要重构并拥有的项目中遇到了以下代码行: SomeClass someClass = new SomeClass(); 我这辈子都想不通为什么有人会以这种方式使用泛型。我想出的唯一原因是
亲爱的,我正在阅读这篇关于通过 asp.net 4 中的代码动态添加元标记的帖子 - 但我想问一下对 SEO 有什么好处,静态添加它或者在代码后面添加它没有问题 http://weblogs.asp.
我是一名优秀的程序员,十分优秀!