I am having a problem when trying to use CPPUTest to test my library.
Everything was fine until i included Eigen library to handle matrix processing. When i tried to build with g++, Eigen library kept throwing errors:
/eigen3/Eigen/src/Core/util/Memory.h:270:41 error: 'ptr' does not name a type
/eigen3/Eigen/src/Core/CoreEvaluators.h:1655:12 error: expected type-specifier before 'static_cast'
/eigen3/Eigen/src/Core/PlainOBjectBase.h:137:5 error: declaration of 'operator new' as non-function
If Eigen or CPPUTest runs separately, no error is output.
My guess is the two libraries have conflicts at some point.
Really need some helps here. Big thanks.
Edit 1: This is my Makefile:
CXX = g++ -std=c++0x -lstdc++ CXXFLAGS = -g -Wall -static -fprofile-arcs -ftest-coverage -I./ -I$(CPPUTEST_HOME)/include LDFLAGS = -L./ -L$(CPPUTEST_HOME)/lib -lCppUTest -lCppUTestExt -pthread CPPUTEST_HOME = ./cpputest/workspace/install USER_CFLAGS = -I /usr/local/include/eigen3 TARGET = MyLibrary SRCS = MyLibrary.cpp MyLibraryTest.cpp OBJS = $(SRCS:.cpp=.o) all: $(TARGET) $(TARGET): $(OBJS) $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS) $(OBJS): $(SRCS) $(CXX) -c $(CXXFLAGS) $^ %.o: %.cpp $(CXX) -c $(CXXFLAGS) $<
.PHONY: clean clean: rm -f $(TARGET) $(OBJS) *.gcno *.gcov ~ find . -name ".gcda" | xargs -r r