unresolved symbols from value.cpp/.h

Maks Orlovich mo85 at cornell.edu
Fri Jan 20 22:26:29 GMT 2006


> > --- internal.h  (revision 500568)
> > +++ internal.h  (working copy)
> > @@ -403,7 +403,7 @@
> >      bool hasInstance(ExecState *exec, ValueImp *value);
> >
> >      virtual const ClassInfo *classInfo() const { return &info; }
> > -    KJS_EXPORT static const ClassInfo info;
> > +    static const ClassInfo info;
>
> Why not? You export the class so there is no need (and msvc produces an
> error) to explicit export a function of this exported class.

Hmm, you're right, I forgot the classes are public, too. 
I wonder why it got added like that in the first place, though -- it was done 
based on build errors, I think.

>
> > Also, IMHO, you shouldn't  do these:
> > -  struct ClassInfo {
> > +  class ClassInfo {
> > +  public:
> >
> > but rather fix the uses.
>
> everywhere else in kdelibs it was changed from struct -> class so I did
> here too.

It's rather rude to override the author's preference, IMHO. And just because 
in other places people did.....

> >>ValueImp::operator=
> >>ValueImp::ValueImp(class KJS::ValueImp const &)
> >
> > This is intentional, to prevent accidental copying.
>
> Ok, let's try to explain why this is needed. We had such a problem some
> time ago (Thiago Macieira was hard to convince).

Well, this is a standard defensive programming practice in C++. 

> Msvc can't export a half implemented class (it doesn't know anything
> about weak symbols) - so you've only two options

This has nothing to do with weak symbols or anything like that. This symbol is 
never referred to from anywhere. 

> a) don't export ths class (which seems to be the best solution because
> you said it's an internal one)

hmm? The class is used all over the place.

> b) implement all functions

May be we need some sort of KJS_DISABLE_COPY macro, like Q_DISABLE_COPY, to 
workaround broken systems?

> btw:
> property_slot.cpp isn't defined as source in SConscript (this was one of
> my four unresolved symbols I have).

I wouldn't know, I use unsermake :-)

Thanks,
Maks




More information about the kde-core-devel mailing list