Hi,
I'm relative new to cpputest and I'm trying to build an first example analogous to the "/CppUTest/examples" Examples. I'm using MinGW c and c++ compiler on Windows 7 Machine.
So, I have .c source files which are located under folder ./ApplicationLib and the .cpp testfiles which are located under ./AllTests .
The configuration in my makefile is set as follows:
TEST_TARGET = test
COMPONENT_NAME = firstexample
CPPUTEST_HOME = ..
TARGET_PLATFORM = Gcc
CPPUTEST_CXXFLAGS := -g -Wall
CPPUTEST_CXXFLAGS += -DRELEASE_CONFIG=1 -DUTEST -DTARGET_R4
CPPUTEST_CFLAGS:= -DRELEASE_CONFIG=1 -DDIAG_HP_AFE_CHIP_INIT_FAIL=1 -DDIAG_HP_AFE_CHIP_MIRROR_MISSMATCH=2 -DDIAG_HP_AFE_CHIP_MIRROR_CRC_MISSMATCH=3 -DDIAG_HP_AFE_CHIP_SPI_DMA_TIMEOUT=194u -DDIAG_HP_AFE_CHIP_WRITE_TO_INVALID_REG=44 -DDIAG_SW_TIMER_THREE_BUSY=45
CPPUTEST_USE_EXTENSIONS:= Y
CPP_PLATFORM = Gcc
INCLUDE_DIRS =\
.\
ApplicationLib\
$(CPPUTEST_HOME)/include\
/other include paths to .h files
include $(CPPUTEST_HOME)/build/MakefileWorker.mk
When I run the makefile, all object files are generated within:
C:\CppUTest\examples\objs\Gcc\AllTests
and
C:\CppUTest\examples\objs\Gcc\ApplicationLib
There is also created a lib "libfirstexample.a" within:
C:\CppUTest\examples\lib\Gcc
The first question is, is it right that the makefile should at first create a static library of the CppUTest and CppUTestExt sources (which represent the CppUTest Framework) so that this library can be linked by the executable. Or should i manually create this library and then put it to the ./lib directory? Some stuff is actually not very clear to me when I take a look into the " MakefileWorker.mk" file.
I get also the following error:
Building archive lib/Gcc/libfirstexample.a
a - objs/Gcc/ApplicationLib/file1.o
a - objs/Gcc/ApplicationLib/file2.o
make: *** No rule to make target `../lib/Gcc/libCppUTest.a', needed by `test'. Stop.
Have tried to set different variables listed in the MakefileWorker.mk but the problem is each time the same.
Maybe you have some idea?
Thx in advance!