Hi folks,

I'm currently doing my first steps using the auto* tools and got a problem
there. My first exercise is building a project consisting of a main program
(hello.cc) using a class defined in another module (hellowindow.cc). Both are
using gtkmm. hello.cc doesn't contain a class definition, but only a main
function.

When running aclocal, autoconf, autoheader, automake, configure and make,
the make exits with an error message:

  g++: cannot specify -o with -c or -S and multiple compilations

What's wrong here?

My configure.in and Makefile.am files are attached to this mail. I wrote
them by copying the example files from http://seul.org/docs/autotut/ and
then leaving out everything that resulted in an error message of the auto*
tools.

Thanks in advance,

  Markus
# verbatim copy (except for the program name and classes check) of the
# configure.in file in "autotut", section 7

AC_INIT(hello.cc)
AM_INIT_AUTOMAKE(hello,0.99)
AM_CONFIG_HEADER(config.h)

CXXFLAGS=

AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MAKE_SET

AC_HEADER_STDC

# AM_PATH_GTK(2.2.0) # yields an error message when running aclocal

AC_LANG_CPLUSPLUS

AC_CHECK_LIB(stdc++, main,,AC_MSG_ERROR(hello requires libstdc++))

AC_OUTPUT(Makefile)
bin_PROGRAMS = hello
LDADD = @GTK_LIBS@
AM_CPPFLAGS = @GTK_CFLAGS@
hello_SOURCES = hello.cc HelloWindow.cc
hello_LDADD = @LIBOBJS@

Reply via email to