o制作动态库时出错

o制作动态库时出错

本文介绍了从.o制作动态库时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从.o文件集中创建动态lib,但是当我这样做时

I'm trying to make dynamic lib from set of .o files, but when i do

我遇到很多错误,例如:

i get a lot of errors like:

"operator new(unsigned long)",引用自: MStatistic.o中的MStatistic :: instance() StatisticObserver.o中的StatisticProfileLoggingObserver :: instance()

"operator new(unsigned long)", referenced from: MStatistic::instance() in MStatistic.o StatisticProfileLoggingObserver::instance() in StatisticObserver.o

ld:架构x86_64找不到符号

ld: symbol(s) not found for architecture x86_64

能否请您帮我,如何解决它并获取我的.dylib?

Can you please help me, how to solve it and get my .dylib?

推荐答案

您可以将-undefined dynamic_lookup作为选项传递给ld,或者:-Wl,-undefined -Wl,dynamic_lookupgccclang(将其传递到链接器).

You can pass -undefined dynamic_lookup as an option to ld, or:
-Wl,-undefined -Wl,dynamic_lookup to gcc or clang (which passes it to the linker).

这篇关于从.o制作动态库时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 08:06