FreeBSD 上对 sbuf 函数的未定义引用

Undefined reference to sbuf functions on FreeBSD

我的 sbuf(9) 怎么了?

这是我的程序:

#include <sys/types.h>
#include <sys/sbuf.h>
#include <unistd.h>

int main() {
    struct sbuf * sb;
    sb = sbuf_new_auto();
    return 0;
}

当我用 clang -v test.c 编译我的程序时,我得到:

FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: i386-unknown-freebsd10.3
Thread model: posix
Selected GCC installation: 
 "/usr/bin/clang" -cc1 -triple i386-unknown-freebsd10.3 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name test.c -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu i486 -v -resource-dir /usr/bin/../lib/clang/3.4.1 -fdebug-compilation-dir /usr/home/0mp/g/freebsd/contrib/openbsm/bin/bsmconv -ferror-limit 19 -fmessage-length 170 -mstackrealign -fobjc-runtime=gnustep -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /tmp/test-fc3a72.o -x c test.c
clang -cc1 version 3.4.1 based upon LLVM 3.4.1 default target i386-unknown-freebsd10.3
ignoring nonexistent directory "/usr/bin/../lib/clang/3.4.1/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/clang/3.4.1
 /usr/include
End of search list.
 "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -m elf_i386_fbsd -o a.out /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib /tmp/test-fc3a72.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
/tmp/test-fc3a72.o: In function `main':
test.c:(.text+0x3d): undefined reference to `sbuf_new'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

备注

试试在编译命令中使用 -lsbuf?