multiply-defined problem

A

ADS7328

Dear everybody,

I trying to compile an aplication and i have got the following error
during
linking phase:



ld: fatal: symbol `K_MultiHandler_c::~K_MultiHandler_c #Nvariant 1()'
is multiply-defined:
(file type=FUNC; file (K_MultiHandler_class.o) type=FUNC);


it seems the include files contains the twice definitions for that
class.
But I cheked and i did not find it.

I'm working on
Solaris 2.8
Sun Studio 9

do you have some idea please ?

thanks
Antonio
 
V

Victor Bazarov

ADS7328 said:
Dear everybody,

I trying to compile an aplication and i have got the following error
during
linking phase:



ld: fatal: symbol `K_MultiHandler_c::~K_MultiHandler_c #Nvariant 1()'
is multiply-defined:
(file type=FUNC; file (K_MultiHandler_class.o) type=FUNC);


it seems the include files contains the twice definitions for that
class.
But I cheked and i did not find it.

I'm working on
Solaris 2.8
Sun Studio 9

do you have some idea please ?

If the destructor is defined _outside_ of the class definition, but
in a header, /and/ has no 'inline' specifier, then the compiler will
attempt to create two definitions of that function *if* the header
is included in more than one translation unit. Add 'inline' to it.

V
 
A

ADS7328

If the destructor is defined _outside_ of the class definition, but
in a header, /and/ has no 'inline' specifier, then the compiler will
attempt to create two definitions of that function *if* the header
is included in more than one translation unit. Add 'inline' to it.

V


Dear Victor,

you are right, that was the problem.
But the matter. if I put "inline" in class definition include file
for destructor i got the same error.

I must comment the destructor line into class definition in include
file
so I 'm able to compile the application.

Many thanks for everythings
ciao
Antonio
 
V

Victor Bazarov

ADS7328 said:
Dear Victor,

you are right, that was the problem.
But the matter. if I put "inline" in class definition include file
for destructor i got the same error.

Put it in front of the function _definition_, not declaration.
I must comment the destructor line into class definition in include
file
so I 'm able to compile the application.

Huh? Not sure what you mean. See FAQ 5.8.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top