multiple definitions, shared library

Roland Leitner
Fri May 12 07:39:00 GMT 2006


i am using cygwin/g++ to make first steps to build C++ code developed
with MSVC 6.0. Later i want to use it on Linux.

The project consists of several sharded libraries. I succeeded in
building the first one (ASIBasics). The second one (ASIXML) uses
ASIBasics. The linker complaines about multiple definitions.

A class DRLException :: std::exception has inline constructor and a few
inline methods. DRLException.h is included in several places as well in
ASIBasics and in ASIXML. Compiler complains about multiple definitions
of DRLException::DRLException() and DRLException::~DRLException() and
about multiple definition of 'typeinfo name for DRLException' and
'typeinfo for DRLException'.

I don't understand this because linking the first library works fine,
but linking against it leads to these errors.

Any ideas?


More information about the Gcc-help mailing list