rkb
rkb

Reputation: 11231

.deps/*.Po: No such file or directory compiler error

My configure.ac looks like

AC_PREREQ(2.61)
AC_INIT(MyProject, 1.0.0, BUG-REPORT-ADDRESS)
AM_INIT_AUTOMAKE([1.10 no-define foreign])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(configure.ac)
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([obj/threading/Makefile])
#AC_OUTPUT([Makefile obj/Makefile obj/threading/Makefile])

AC_USE_SYSTEM_EXTENSIONS
AC_LANG([C++])
AC_PROG_CXX([clang++ g++])

AX_CXX_COMPILE_STDCXX_11()
AS_IF([test "x$HAVE_CXX11" != "x1"],
      [AC_MSG_ERROR([** A compiler with C++11 language features is required.])])

CXXFLAGS='-Wall -std=c++11'
AC_SUBST(CXXFLAGS)

AC_OUTPUT

My Makefile.am looks like

AUTOMAKE_OPTIONS = subdir-objects

SRCDIR = $(top_srcdir)/src/threading

bin_PROGRAMS = node                 

node_SOURCES  = $(SRCDIR)/UnitTests/node.cpp
node_CPPFLAGS = 
node_LDFLAGS  = 
node_CXXFLAGS = $( CXXFLAGS ) 

I get following error

Makefile:394: ../../src/threading/UnitTests/.deps/node-node.Po: No such file or directory

Upvotes: 4

Views: 7060

Answers (3)

mhck
mhck

Reputation: 1061

In Makefile.am, try the following. The "no-dependencies" setting will prevent the .deps/ folder and .Po files from being created.

AUTOMAKE_OPTIONS = subdir-objects no-dependencies

see https://www.gnu.org/software/automake/manual/html_node/Dependencies.html

Upvotes: 1

Kemin Zhou
Kemin Zhou

Reputation: 6891

I encountered the same problem got it resolved by calling autoreconf -if in the project root directory

Makefile:577: .deps/testAll-bar_test.Po: No such file or directory
Makefile:579: .deps/testAll-main_testall.Po: No such file or directory
make[3]: *** No rule to make target '.deps/testAll-main_testall.Po'.  Stop.

autoreconf -if
./configure
make # no more problem

I am using gtest for my C++ project. The Makefile.am file is straightforward, nothing unusual.

Upvotes: 1

Bas Vodde
Bas Vodde

Reputation: 101

I've had a similar problem with my autoconf files when I upgraded my autoconf version. I noticed there is a bug report on the Debian list: Bug #752993 that seems related to this problem. So, it seems that we've hit a bug in the autoconf project.

I've followed the workaround in the bug-report and that worked well for me. So, it meant that I removed the "AUTOMAKE_OPTIONS = subdir-objects" in the Makefile.am. After doing that, I got lots of warnings on autoreconf, but it does work afterwards. So, you might want to try that out. Hope it helps you forward (after 9 months!)

Upvotes: 3

Related Questions