SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] programming


Chronological Thread 
  • From: Thomas Dreibholz <dreibh AT exp-math.uni-essen.de>
  • To: "Naveen.R.Ranga" <naveenreddy32 AT yahoo.com>, Michael Tuexen <Michael.Tuexen AT lurchi.franken.de>
  • Cc: Andreas Jungmaier <ajung AT exp-math.uni-essen.de>, discussion AT sctp.de
  • Subject: Re: [SCTP-Discussion] programming
  • Date: Sun Jun 1 19:27:02 2003
  • List-id: SCTP Discussions <discussion.sctp.de>
  • Organization: University of Essen, Institute for Experimental Mathematics

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Donnerstag, 29. Mai 2003 15:50 schrieb Naveen.R.Ranga:
> Hi,
> Thanks for the message. I have done exactly as u told me. But my testt
> program still fails. The program is: //-----
> #include <stdio.h>
> #include <stdlib.h>
> #include <errno.h>
> #include <string.h>
> #include <sys/types.h>
> #include <netinet/in.h>
> #include <sys/socket.h>
> #include <sys/wait.h>
> #include <sctp.h>
> #include <ext_socket.h>
> //#include <netinet/sctp_uio.h>
>
> main()
> {
> int fd,ret,newfd;
> struct sockaddr_in s, who;
> fd=ext_socket(PF_INET,SOCK_STREAM,IPPROTO_SCTP);
> if(fd<0)
> {
> printf("Socket Failed\n");
> exit(1);
> }
> printf("I am fine here\n");
> }//end main
>
> //------
> and it gives me this error(recognizing the files but not the
> "ext_socket"call) when compiled with gcc -o tes testprogram.c -lsctp -lglib
> //--error--*********************
>
> tmp/cc8jlr35.o(.text+0x1d): In function `main':
> : undefined reference to `ext_socket'

You link glib and sctp, but you use the SCTP socket API to access SCTP. In
this case, you also need to link with "-lsctpsocket -lstdc++". Try this line:
gcc -Wall -g -O0 -o tes testprogram.c -lsctpsocket -lstdc++ -lsctp -lglib


Best regards
- --
=======================================================================
Dipl.-Inform. Thomas Dreibholz

University of Essen, Room ES210
Inst. for Experimental Mathematics Ellernstraße 29
Computer Networking Technology Group D-45326 Essen/Germany
- -----------------------------------------------------------------------
E-Mail:
dreibh AT exp-math.uni-essen.de
Homepage: http://www.exp-math.uni-essen.de/~dreibh
=======================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+2jL532BbsHYPLWURAk6mAJ9cXjcP3h0+nVank9yWi6uP4Wb7SgCgosQQ
OwcNFsurVU2TX8ug+K0oFLc=
=omKK
-----END PGP SIGNATURE-----




Archive powered by MHonArc 2.6.19+.

Top of page