automake & C++ library problem

From: Adam Dyga (adeon_at_NOOOSPAMtlen.pl)
Date: 10/14/04


Date: Thu, 14 Oct 2004 17:03:36 GMT

Hello,

It's not exactly C programming related question, but I suspect that many of you, linux developers, know autotools well.

I want to create a C++ library from scratch. So I created project directory, with configure.in and Makefile.am
 in it, and  'src' subdirectory with Makefile.am.

Mentioned files contain:

configure.in:

 AC_INIT(deflatec++, 1.00)
 AM_INIT_AUTOMAKE
 AC_LANG(C++)
 AC_PROG_CXX
 AC_PROG_INSTALL
 AC_PROG_RANLIB
 AC_OUTPUT(Makefile src/Makefile)

Makefile.am:

 SUBDIRS = src

src/Makefile.am:

 bin_PROGRAMS = deflatetest
 deflatetest_SOURCES = deflatetest.cc
 include_HEADERS = DeflateCompress.h DeflateDecompress.h
 lib_LIBRARIES = libdeflatec++.a
 libdeflatec++_a_SOURCES = DeflateCompress.cc DeflateDecompress.cc DeflateCompress.h DeflateDecompress.h

(all files .h and .cc ofcourse exist)

Running autoreconf gives me the following error (originated from automake in fact):

/usr/share/automake-1.9/am/depend2.am: am__fastdepCC does not appear in AM_CONDITIONAL
src/Makefile.am: C source seen but `CC' is undefined
src/Makefile.am:
src/Makefile.am: The usual way to define `CC' is to add `AC_PROG_CC'
src/Makefile.am: to `configure.in' and run `autoconf' again.
autoreconf: automake failed with exit status: 1

And here I don't know what is going on, I don't know where automake see any C source... :(
But OK, I'm adding AC_PROG_CC to configure.in and running autoreconf, configure and make.
I'm getting this:

Making all in src
make[1]: Entering directory `/home/adeon/deflatec++/src'
make[1]: *** No rule to make target `libdeflatec++.c', needed by `libdeflatec++.o'.  Stop.
make[1]: Leaving directory `/home/adeon/deflatec++/src'
make: *** [all-recursive] Error 1

What am I doing wrong?

Greets
Adam



Relevant Pages

  • autoconf and gtkmm
    ... I'm really a novice at autoconf and automake and trying to learn some ... automake and it seems to fail to pickup the gtkmm and gtk library ... This is my src directory Makefile.am ... http://www.nylxs.com - Leadership Development in Free Software ...
    (comp.os.linux.development.apps)
  • Re: Automake and Directories
    ... "Paulo Matos" writes: ... I have the project dir which has a src ... > doesn't seem to be recognized by automake. ... > with this and this is giving so many headaches. ...
    (comp.unix.programmer)
  • Re: Automake and Directories
    ... > I have the project dir which has a src dir and inside the src dir I ... Doesn't automake recognize recursively the files inside the ... I used VPATH in my manual Makefiles. ... > I'm losing so much time with this and this is giving so many headaches. ...
    (comp.unix.programmer)
  • Need help!! (Compiling in KDevelop)
    ... So I created the second .cpp and the hello_world.h in the src dir ... In the Automake Manager I have a "tree" showing src in the upper ...
    (comp.lang.cpp)