Re: TBRIK inheritance

From: Valery Fine (fine@mail.cern.ch)
Date: Fri Nov 21 1997 - 09:47:50 MET


Dear William

On 19 Nov 97 at 19:02, you  wrote:

> 
> I'm having difficulty with the following class which inherits TBRIK
> on my WinNT (x86) workstation:
> 
> class Brick: public TBRIK
> {
>     protected:
>   Float_t fx;
>   Float_t fy;
>   Float_t fz;
>     public:
>         Brick();
>         Brick(Text_t *name, Text_t *title, Text_t *material, Float_t
>         dx,
> Float_t dy, Float_t dz, Float_t x, Float_t y, Float_t z);
>         ~Brick();
>         virtual void    Paint(Option_t *option);
>         virtual void    SetPoints(Float_t *buff);
>   void MakeSegments(Int_t *segs, Int_t c);
>   void MakePolygons(Int_t *polys, Int_t c);
>         ClassDef(Brick,1)  //TBrickshape
> };
> 
> I build the dictionary using rootcint and all compiles error and
> warning free.  But during the link stage, I get the following:
> 
> LINK : warning LNK4103: import of deleting destructor "public:
> virtual void
> * __thiscall TAttLine::`vector deleting destructor'(unsigned int)"; image
> may not run correctly
> LINK : warning LNK4103: import of deleting destructor "public:
> virtual void
> * __thiscall TAttFill::`vector deleting destructor'(unsigned int)"; image

   ....

> Should I worry about the warnings?  And if not, how to I deal with
> the unresolved external references? As always, I'm really grateful
> for all the help that the ROOT team and supporters have given me. 
> Have a beer on me. :)
> 


  I took the source of your class and built a nice DLL from the 
command prompt as follows:

  cl /LD /MD -DWIN32 -I%Rootsys%\src Brick.cpp  %rootsys%\lib\*.lib


  with NO error or even warning messages !
 
  You said:

> I'm compiling the project as a statically linked console application
> not using MFC. 

  I think you problem here "a statically linked"

  TWO notes:

     1. The symbol WIN32 MUST be defined !

     2. All ROOT libraries are the export ones this means your 
        Project MUST be Multithread DLL  (It is only option to link 
        against of DLL's, there is NO SingleThread DLL). So the 
        option /MD must be present with your command line

  The only thing I had to do I had to add two missing methods in your 
Class, namely:

void Brick::Streamer(class TBuffer &b)
{TBRIK::Streamer(b);}

void Brick::ShowMembers(class TMemberInspector &inspect,char *string)
{
     TBRIK::ShowMembers(inspect,string);
}

since you did not supply your dictionary file.

I'd  like to call your attention that your example is NO use.
To be useful you are required:

   1. to supply a real ROOT dictionary. This will allow to use this 
      class from the ROOT interactive sessions.

      http://root.cern.ch/root/RootCintMan.html

   2. to create a "Module Definition file" DEF. This will allow you 
      to link your future application against of your Brik.DLL 
      This file is created with a special utility BINDEXPLIB.exe 
      (see root/bin directory). Makefile from the "test" subdirectory 
      shows how this utility can be used.

  Hope this helps,

           With my best regards,
                          Valery

 
Dr. Valeri Faine (Valery Fine)
    ------------ -------------   Phone: +41 22 767 4921
CERN                             FAX  : +41 22 767 7155
CH-1211 Geneva, 23               mailto:fine@mail.cern.ch 
Switzerland                      http://nicewww.cern.ch/~fine
                                 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:22 MET