Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello All, Does anyone know of a

Status
Not open for further replies.

eswhite

Programmer
Jul 6, 2000
18
US
Hello All,

Does anyone know of a way to statically link the socket and nsl libraries into an executable?

I have tried:

g++ -o myfile.out myfile.o -Wl,-Bstatic -lsocket -lnsl

but I get undefined symbol errors for
dclose etc ... I can get it to compile by using:

g++ -ldl -lnsl -o myfile myfile.o -Wl,-Bstatic -lsocket

I would like to statically link all libraries envolved if possible.

Thanks,
Eric
 
add -v (-Wl,-v) option to see what libraries have been loaded. This can help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top