Search code examples
clinuxsocketsunix

undefined reference to `sctp_get_no_strms'


I have a link error when trying to use sctp_get_no_strms function. I am running Slackware 14.1 and have lksctp-tools installed.

# ls /var/log/packages | grep sctp
lksctp-tools-1.0.16-x86_64-1_SBo

However libsctp symbol list does not include this function.

# nm -D /usr/lib64/libsctp.so | grep sctp_get
0000000000001100 T sctp_getaddrlen
00000000000010e0 T sctp_getladdrs
00000000000010c0 T sctp_getpaddrs

Is sctp_get_no_strms not supported by lksctp-tools?

The compilation command is as follows:

gcc -o srv sctpserv01.o sctp_wrapper.o -L../lib -lsock -lsctp

Solution

  • It turns out that function is defined in the source code available for the book. Confusingly it is not declared in the header file unp.h. It is defined in sctp/sctp_getnostrms.c.