I am not too familiar with how linking works, so apologies ahead of time if I do not have enough detail.
I have installed the bsd library with sudo apt-get install libbsd-dev
on ubuntu 11.10 I am relatively certain this has been installed, as the man function for heap/mergesort exists (the functions I am looking for)
The C file that I wish to compile has #include <bsd/stdlib.h>
at the top of the file. I am also #include <stdlib.h>
.
The Makefile works for other libraries, including time.h gives me struct timespec
Is there some error in assuming where apt-get installs libbsd to? Is the second stdlib somehow clashing?
Once again, apologies for the sparse detail.
Code for Makefile below:
CFLAGS=-g -O2 -Wall -Wextra -Isrc -rdynamic -DNDEBUG $(OPTFLAGS)
LIBS=-llcthw -lbsd -lrt -ldl $(OPTLIBS)
LDLIBS=-lbsd -lrt -ldl
PREFIX?=/usr/local
SOURCES=$(wildcard src/**/*.c src/*.c)
OBJECTS=$(patsubst %.c,%.o,$(SOURCES))
TEST_SRC=$(wildcard tests/*_tests.c)
TESTS=$(patsubst %.c,%,$(TEST_SRC))
TARGET=build/liblcthw.a
SO_TARGET=$(patsubst %.a,%.so,$(TARGET))
all : $(TARGET) $(SO_TARGET) tests