"Matthew R. MacIntyre" wrote:
>
> Hi,
>
> I'm sure there is a fairly easy way to do this, but I just can't figure it
> out. I was hoping someone here could help me.
>
> I've got some c++ classes in my project's src/ directory, and I want to
> write some little driver programs in the test/ directory to show that the
> classes behave as expected. I've had no problem including the header
> files I need to compile the driver programs, but errors occur at the
> linking phase of the build process. How can I get automake setup the
> Makefile in the test/ directory to link with the objects in the src/
> directory?
>
> Thanks in advance,
>
> -matt
Wrap your objects in a noinstall library and have the test programs link
with it.
ie.
in your C++ directory:
noinst_LIBRARIES = libMyCplusplus.a
in your test directory:
testprogram_LDADD = -D../C++ directory -lMyCplusplus
This is off the top of my head and untested. I have used this with C
code and libtool libraries but I understand that there are some problems
with shared libraries and C++ initialization on some platforms.
Michael
--
------------------------------------------------------------------
Michael Bletzinger Software Developer, Alliance Computational
[EMAIL PROTECTED] Environment & Security
217 265 5137 NCSA