/ usr / bin / ld:client:隐藏符号`__dso_handle' [英] /usr/bin/ld: client: hidden symbol `__dso_handle'
问题描述
命令我用过: g ++ -o client Client.cpp - L.
<$ c 在/usr/lib/gcc/i486-linux-gnu/4.4.3/crtbegin.o中的$ c> / usr / bin / ld:client:隐藏符号`__dso_handle'被DSO引用
/ usr / bin / ld:最终链接失败:输出的非代表性部分
collect2:ld返回1退出状态
如何解决这个错误?
隐藏符号`__dso_handle'位于/ usr / lib /gcc/i486-linux-gnu/4.4.3/crtbegin.o被DSO引用
推测 libprint.so
是引用DSO。您可以确认:
nm ./libprint.so | grep __dso_handle
如果产生 U __dso_handle
输出,您的 libprint.so
构建不正确(很可能您使用 ld -shared
来链接它。这样做,请使用编译器驱动程序,例如 g ++ -shared ...
)。
I am trying to link with a shared lib in my C++ program.
command I used: g++ -o client Client.cpp -L. -lprint
Following is the error:
/usr/bin/ld: client: hidden symbol `__dso_handle' in /usr/lib/gcc/i486-linux-gnu/4.4.3/crtbegin.o is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
How can I resolve this error?
hidden symbol `__dso_handle' in /usr/lib/gcc/i486-linux-gnu/4.4.3/crtbegin.o is referenced by DSO
Presumably libprint.so
is that referencing DSO. You can confirm with:
nm ./libprint.so | grep __dso_handle
If that produces a U __dso_handle
output, your libprint.so
was built incorrectly (most likely you used ld -shared
to link it. Don't do that, use the compiler driver, e.g. g++ -shared ...
instead).
这篇关于/ usr / bin / ld:client:隐藏符号`__dso_handle'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!