Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/bin/ld: client: hidden symbol `__dso_handle'

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?

like image 425
user2536285 Avatar asked Jun 30 '13 10:06

user2536285


1 Answers

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

like image 51
Employed Russian Avatar answered Sep 24 '22 15:09

Employed Russian