No rule to make target `../lib/Gcc/libCppUTest.a

1,271 views
Skip to first unread message

milexy86

unread,
Jul 31, 2015, 11:25:53 AM7/31/15
to cpputest
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!

milexy86

unread,
Aug 4, 2015, 4:18:30 AM8/4/15
to cpputest
Have solved this problem by just manually creating a ./lib directory in the CppUtest Root directory and copying the CppuTest.a and CppuTestExt.a to this directory ... :)

Tibor Koroknai

unread,
Jan 22, 2016, 1:38:03 PM1/22/16
to cpputest
This is odd I thought this was a specific problem to my system but it is occurred on Ubuntu 14.04 with autogen.sh and scientific linux with cmake.

A. Robert S.

unread,
Feb 29, 2016, 3:09:45 AM2/29/16
to cpputest
Hi there,

I wouldn't include the cpputest build in the build of any of my projects, unless I had a very good reason (and so far, I never had a good enough reason ;-).

If I were you, I would build CppUTest separately, just once. I don't know whether 'make install' works with MinGW, but I'd give that a shot, too, and otherwise, copy and keep the libraries/headers in a directory suitable for my project.

Regards,
Robert
Reply all
Reply to author
Forward
0 new messages