Hi,
I made the following simple files (TMyClass.h):
[code]#ifndef ROOT_TMyClass
#define ROOT_TMyClass
#ifndef ROOT_TObject
#include “TObject.h”
#endif
class TMyClass : public TObject {
// TMyClass();
// virtual ~TMyClass();
ClassDef(TMyClass,2)
};
#endif[/code]
and TMyClass.c
[code]#include “TMyClass.h”
ClassImp(TMyClass)
TMyClass::TMyClass(): TObject()
{
}
TMyClass::~TMyClass()
{
}[/code]
If I uncomment the two lines in the .h file, i.e. I have both contructor and destructor I receive the message
[quote]root [13] .L TMyClass.c+
Info in TWinNTSystem::ACLiC: creating shared library C:\veghj\projects\root\ewa\TMyClass_c.dll
23596100_cint.cxx
s1pc_1n.cxx
Creating library C:\veghj\projects\root\ewa\TMyClass_c.lib and object C:\veghj\projects\root\ewa\TMyClass_c.exp[/quote]
i.e. this simple case compiles OK. If I try to compile the files as shown above (i.e. I do have neither constructor nor destructor) I receive
[quote]root [12] .L TMyClass.c+
Info in : modified script has already been compiled and loaded
Info in : it will be regenerated and reloaded!
Info in TWinNTSystem::ACLiC: creating shared library C:\veghj\projects\root\ewa\TMyClass_c.dll
22376120_cint.cxx
s1pc_1i.cxx
C:\veghj\projects\root\ewa\TMyClass.c(5) : error C2084: function ‘__thiscall TMyClass::TMyClass(void)’ already has a body
C:\veghj\projects\root\ewa\TMyClass.c(10) : error C2084: function ‘__thiscall TMyClass::~TMyClass(void)’ already has a body
C:\veghj\projects\root\ewa\s1pc_1i.cxx(130) : error C2264: ‘TMyClass::TMyClass’ : error in function definition or declaration; function not called
C:\veghj\projects\root\ewa\s1pc_1i.cxx(130) : error C2264: ‘TMyClass::TMyClass’ : error in function definition or declaration; function not called
C:\veghj\projects\root\ewa\s1pc_1i.cxx(276) : error C2264: ‘TMyClass::TMyClass’ : error in function definition or declaration; function not called
Error in : Compilation failed![/quote]
i.e. interestingly enough, the missing members are reported as duplicate rather than missing. A rather misleading message!
Also interesting that if I remove the function definitions, too, I receive
[quote]root [14] .L TMyClass.c+
Info in : modified script has already been compiled and loaded
Info in : it will be regenerated and reloaded!
Info in TWinNTSystem::ACLiC: creating shared library C:\veghj\projects\root\ewa\TMyClass_c.dll
23912100_cint.cxx
s1pc_1s.cxx
Creating library C:\veghj\projects\root\ewa\TMyClass_c.lib and object C:\veghj\projects\root\ewa\TMyClass_c.exp
s1pc_1s.obj : error LNK2001: unresolved external symbol “private: virtual __thiscall TMyClass::~TMyClass(void)” (??1TMyClass@@EAE@XZ)
C:\veghj\projects\root\ewa\TMyClass_c.dll : fatal error LNK1120: 1 unresolved externals
Error in : Compilation failed![/quote]
i.e. only the missing destructor is noticed, the constructor not.
I also think it is not of much use to report the line number of the temporary file where the error detected, if the file itself is deleted.
Janos