Simple Socket Library Not so simple

This is a discussion on Simple Socket Library Not so simple within the C Programming forums, part of the General Programming Boards category; I know that im not being very helpful with this and its not the nicest problem in the world, but ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    2

    Simple Socket Library Not so simple

    I know that im not being very helpful with this and its not the nicest problem in the world, but I would be greatful of any help.

    Please help me, I have been looking at socket programming and found it hard to get my head around so, i thort id look at a library, i found the SIMPLE socket library at http://mysite.verizon.net/astronaut/ssl/ sounds like a good idea but when I try compiling the code I get this, There is no information about this that I can see on the web,plus im new to adding non standard librarys.

    testsrc # make all
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Saccept.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sprintf.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Stest.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c outofmem.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sclose.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sprtskt.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Stimeoutwait.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c rdcolor.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sgets.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sputs.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Svprintf.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c sprt.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Smaskwait.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sread.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Swait.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c srmtrblk.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Smkskt.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sreadbytes.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Swrite.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c stpblk.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sopen.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Srmsrvr.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c error.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c stpnxt.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sopenv.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sscanf.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c fopenv.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c strnxtfmt.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Speek.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c cprt.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Speername.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Speeraddr.c
    /opt/sfw/gcc-3/bin/gcc -O -I./HDR -c Sinit.c
    ar r simpleskts.a *.o
    ar: creating simpleskts.a
    finished updating simpleskts.a
    ( cd EXE; \
    make LIB=simpleskts.a CFLAGS="-O -I../HDR" LOADLIBES=../simpleskts.a EXETGT=../EXE )
    /opt/sfw/gcc-3/bin/gcc -O -I../HDR Spm.c ../simpleskts.a -o ../EXE/Spm
    Undefined first referenced
    symbol in file
    bind /var/tmp//ccVRYMI1.o
    recv ../simpleskts.a(Sgets.o)
    send ../simpleskts.a(Swrite.o)
    getsockname /var/tmp//ccVRYMI1.o
    accept ../simpleskts.a(Saccept.o)
    listen /var/tmp//ccVRYMI1.o
    gethostbyname /var/tmp//ccVRYMI1.o
    socket /var/tmp//ccVRYMI1.o
    setsockopt /var/tmp//ccVRYMI1.o
    connect ../simpleskts.a(Sopen.o)
    getpeername /var/tmp//ccVRYMI1.o
    shutdown /var/tmp//ccVRYMI1.o
    ld: fatal: Symbol referencing errors. No output written to ../EXE/Spm
    collect2: ld returned 1 exit status
    *** Error code 1
    make: Fatal error: Command failed for target `Spm'
    Current working directory /scripts/Ctuts/new/COSMIC/EXE
    *** Error code 1
    make: Fatal error: Command failed for target `exes'


    seems to work fine to start with then bombs out, can any one help
    im using solaris 9

    thanks in advance.

    Joe
    Last edited by jbully; 11-04-2005 at 08:51 AM. Reason: I need help :(

  2. #2
    Bioport Productions
    Join Date
    Oct 2005
    Posts
    215
    Yea, get a new library or consult the documentation.
    -"What we wish, we readily believe, and what we ourselves think, we imagine others think also."
    PHP Code:
    sadf 

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    2
    Yea, any sugrestions on what library ( where to find it ), I did read the docs on the library i have it said to compile type make all, the out put you see is the result.
    THanks
    Joe

  4. #4
    ---
    Join Date
    May 2004
    Posts
    1,379

  5. #5
    Registered User
    Join Date
    Dec 2010
    Posts
    1

    Re: Simple Socket Library Not so simple

    All those functions that you list as "undefined first reference" are Solaris-system-provided functions, not Simple Sockets Library provided functions. Apparently your system's socket functions reside in one or more libraries that isn't/aren't currently getting linked in. I don't have a Solaris system myself; however, it didn't take too much effort to use the web and find out that you need to have -lsocket -lnsl on your link line. An easy way to do that:

    export LDFLAGS="-lsocket -lnsl"

    will (probably) do the trick. (looked at A Crash Course in UNIX TCP/IP Socket Programming)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with simple socket client/server program
    By spencer88 in forum C Programming
    Replies: 6
    Last Post: 05-05-2009, 11:05 PM
  2. Replies: 12
    Last Post: 02-10-2009, 01:14 PM
  3. Need help with audio library on DOS...
    By Marton79 in forum C Programming
    Replies: 10
    Last Post: 08-25-2006, 12:32 AM
  4. socket newbie, losing a few chars from server to client
    By registering in forum Linux Programming
    Replies: 2
    Last Post: 06-07-2003, 11:48 AM
  5. Linker errors with simple static library
    By Dang in forum Windows Programming
    Replies: 5
    Last Post: 09-08-2001, 09:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21