unresolved symbols from value.cpp/.h

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Sat Jan 21 09:29:14 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maks Orlovich schrieb:
>>>--- 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.
Or maybe first you only wanted to export those functions and later the
whole class and then forgot to remove KJS_EXPORT. :)
> 
> 
>>>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.....
okĀ“- I don't care if there is struct or class and just wanted to be
consistent in kdelibs.
> 
> 
>>>>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. 
See
http://lists.kde.org/?l=kde-core-devel&m=113069297624184&w=2
> 
> 
>>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.
This doesn't make sense - either you need it outside kjs and export it
or you only need it niternally without a need for exporting.

But this doesn't work too because the derived classes are exported and
therefore the functions are missing then.
> 
> 
>>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 :-)
I'll provide a patch with all changes you agreed with today.

Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD0f7qHAIuqbOiZ+kRAtGcAJ9NWr1sky2Z3AqD4nRBJvlwMPENwQCgzPL3
5hqqD2gidnvyHCzapy4NYZA=
=KK4b
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list