Frage

I have a code:

struct hostent *hp = gethostbyname(dns.c_str());

in my app. I compile it on Ubuntu server linking all statically. All ok, but when i try to start this app on CentOS i have a error in this gethostbyname calling:

Floating point exception

Can you help me how to fix that? Thanks!

War es hilfreich?

Lösung

static linking considered harmful http://www.akkadia.org/drepper/no_static_linking.html

"all kinds of features in the libc (locale (through iconv), NSS, IDN, ...) require dynamic linking to load the appropriate external code."

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top