Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 10 19:27:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8B2RV42028692 for ; Wed, 10 Sep 2008 19:27:31 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m8B2R7Wx025688 for ; Wed, 10 Sep 2008 19:27:07 -0700 Message-Id: <200809110227.m8B2R7Wx025688@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Library Reference Date: Wed, 10 Sep 2008 19:27:07 -0700 From: Bill Cheng Someone wrote: > Any Idea what other library I need to link or .h I need to include? > > Regards, > > Alex > > g++ -o client Client.o Common.o ClientParse.o > -L/home/scf-22/csci551b/openssl/lib -lcrypto -lsocket > Undefined first referenced > symbol in file > gethostbyname Client.o (symbol belongs to implicit > dependency /usr/lib/libnsl.so.1) > inet_addr Common.o (symbol belongs to implicit > dependency /usr/lib/libnsl.so.1) > inet_ntoa Client.o (symbol belongs to implicit > dependency /usr/lib/libnsl.so.1) > ld: fatal: Symbol referencing errors. No output written to client > collect2: ld returned 1 exit status > *** Error code 1 > make: Fatal error: Command failed for target `client' > nunki.usc.edu(129): The linker is giving you hints... It says that you need to link to "libnsl.so.1". So, the name of the library is "nsl". Therefore, you should try "-lnsl". -- Bill Cheng // bill.cheng@usc.edu