[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mixing C and C++?
From: |
Erik de Castro Lopo |
Subject: |
Re: Mixing C and C++? |
Date: |
Fri, 6 Jun 2008 21:49:15 +1000 |
Ralf Wildenhues wrote:
> Please post a small example package that exposes this, or, if that's too
> much work, the configure.ac and tests/Makefile.am files; and state which
> program versions you use.
Trying to set up a test showed up an even bigger problem. I'm using:
automake (GNU automake) 1.9.6
autoconf (GNU Autoconf) 2.61
ltmain.sh (GNU libtool) 1.5.26 Debian 1.5.26-1ubuntu1 (1.1220.2.493
2008/02/01 16:58:18)
installed from packages on an Hardy Heron machine.
The test project is here:
http://www.mega-nerd.com/tmp/amtest-0.1.tar.gz
If I extract these sources and do:
./autogen.sh (which also runs configure)
make
it results in the following error:
if gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT amtest.o -MD -MP \
-MF ".deps/amtest.Tpo" -c -o amtest.o amtest.c; \
then mv -f ".deps/amtest.Tpo" ".deps/amtest.Po"; else rm -f \
".deps/amtest.Tpo"; exit 1; fi
/bin/bash ./libtool --tag=CC --mode=link gcc -g -O2 -o amtest amtest.o
mkdir .libs
gcc -g -O2 -o amtest amtest.o
amtest.o: In function `main':
/tmp/amtest-0.1/amtest.c:10: undefined reference to `cpp_test'
For some reason, the automake generated Makefile drops the C++ object
file from the link.
What am I doing wrong here?
Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Two hands working can do more than a thousand clasped in prayer."
-- anonymous
- Mixing C and C++?, Erik de Castro Lopo, 2008/06/06
- Re: Mixing C and C++?, Ralf Wildenhues, 2008/06/06
- Re: Mixing C and C++?,
Erik de Castro Lopo <=
- Re: Mixing C and C++?, Ralf Wildenhues, 2008/06/06
- Re: Mixing C and C++?, Erik de Castro Lopo, 2008/06/06
- Re: Mixing C and C++?, Olly Betts, 2008/06/06
- Re: Mixing C and C++?, Erik de Castro Lopo, 2008/06/06
- Re: Mixing C and C++?, Ralf Wildenhues, 2008/06/06
- Re: Mixing C and C++?, Erik de Castro Lopo, 2008/06/06