I'm using Google Test for C++ and trying to set it up on my linux machine. My make file has the following code:
CC=g++
CFLAGS=-I $(GOOGLETESTDIR)/include -L $(GOOGLETESTDIR)/lib -lgtest -lpthread -Wall
DEPS=fib.h
OBJS=fib.o main.o
all: | r6
clean:
-rm -f r6 $(OBJS)
%.o: %.cpp $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
r6: $(OBJS)
$(CC) -o $@ $^ $(CFLAGS)
.PHONY: all clean
I get the error when I run make:
/usr/bin/ld: cannot find -lgtest
How do I fix this? I'm new to this kind of testing and rather new to linux so I'm really lost.
$GOOGLETESTDIR
set in the shell you are runningmake
from? If so, what are the contents of${GOOGLETESTDIR}/lib
? – Libidinous