Linking warning

I am linking my application an dgetting the following warning message:
warning: Using ‘gethostbyname’ in statically linked applications requires at runtime the shared libraries from the glibc version used for linking.

I need to link statically.
I also understand that I am linking dynamicall with NSS libraries.

But can I somehow to get rid of this message ?
Is any workaround exist ?

Thx,
Alexander

Hi Alexander,

I’m not sure I understand your question. Do you want to just not get the message, or actually build your app so that no dynamic, shared libraries are required? The PGI tools use the gnu linker ld, and you can investigate the command we use with the -v flag to the compiler. You might be able to change the linking behavior by the placement of the -Bstatic and -Bdynamic options to ld. What you want may require you to build your own versions of glibc…?

Let me know.

  • Brent