[kde-solaris] KDE 3.1RC3 Compile Problem

Cory C. Omand kde-solaris@mail.kde.org
Thu Nov 21 17:36:00 2002


Thanks for your reply - I made it past this problem.  The first thing I 
tried was to make the access protected, but this had other, less 
understandable side effects.  As the ItemList is really only referred to 
by the inner class, I just added it to the private section of the Item 
object:

class KAccelleratorManagerPrivate
{
public:
...
private:
...
    class Item
    {
     private:
            typedef QPtrList<Item> ItemList;

     public:
     ....
    };
};

This compiles with no warnings, although I'm not fully aware at this 
point what the effect of the change will be.  I couldn't even get the 
code to compile if I switch the order of the public/private sections 
within ::Item, so something is definitely wierd with my build system.

Now that I'm through this block (though maybe only temporarily, if I've 
modified critical functionality in KAcceleratorManager), I am getting 
hung up with kmainwindow.cpp.  There is a package private variable named 
no_query_exit which is giving me a huge headache.  When compiled as 
normal, I get a link error:

Undefined                       first referenced
 symbol                             in file
no_query_exit                       
/usr/share/src/build/kderc/kdelibs-3.0.99/kdeui/.libs/SunWS_cache/CC_obj_1/1UkbJBWKPTybgp5RlCBu.o

There are other package private variables that are accessed from various 
areas of the file (e.g. ksm, ksmd), which do not give any link time 
errors.  The difference seems to be that no_query_exit is referred to 
from within a class declaration, while the others are referred to from 
function definitions.  E.g.

class KMWSessionManaged : public KSessionManaged
{
public:
...
    bool commitData( QSessionManager& sm )
    {
         ....
         ::no_query_exit = true;
....

vs. this:

void KMainWindow::initKMainWindow(const char *name)
{
    ...
    if ( !ksm )
        ksm = ksmd.setObject(new KMWSessionManaged());

Nothing I have tried so far, short of commeting no_query_exit out 
altogether, makes kmainwindow.cpp compile!  On a related note, I 
attempted an experiment to build a separate tree using GCC 3.2 on the 
same machine - it failed horribly while compiling QT 3.1.0.

Any pointers appreciated,
Cory.

P.S.  For those wondering, my capacity within Sun is not related to 
window managers whatsoever - this is a sideline interest for me.

Wout Mertens wrote:

>Hi Cory,
>
>On Sat, 16 Nov 2002, Cory C. Omand wrote:
>
>  
>
>>I'm attempting to compile KDE 3.1RC3 on Solaris 9 using the SunOne
>>Developer Studio 7 compiler collection, and am running into some strange
>>problems.  I have made it as far as kdelibs - kdeui to be exact.  Within
>>    
>>
>
>[...]
>
>  
>
>>Can anyone give me a pointer as to why this error is occuring:
>>
>>Making all in kdeui
>>make[2]: Entering directory
>>`/usr/share/src/build/kderc/kdelibs-3.0.99/kdeui'
>>Making all in .
>>make[3]: Entering directory
>>`/usr/share/src/build/kderc/kdelibs-3.0.99/kdeui'
>>source='kaccelmanager.cpp' object='kaccelmanager.lo' libtool=yes \
>>depfile='.deps/kaccelmanager.Plo' tmpdepfile='.deps/kaccelmanager.TPlo' \
>>depmode=none /bin/bash ../admin/depcomp \
>>/bin/bash ../libtool --silent --mode=compile --tag=CXX CC
>>-DHAVE_CONFIG_H -I. -I. -I.. -I../kdefx -I../interfaces -I../dcop
>>-I../libltdl -I../kdecore -I../kdeui -I../kio -I../kio/kio
>>-I../kio/kfile -I.. -I/opt/kde/include     -mt -DQT_THREAD_SUPPORT
>>-I/usr/local/include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
>>-DUSE_SOLARIS -DSVR4 -I/usr/local/include  -O -library=Crun,Cstd
>>-DQT_NO_TRANSLATION -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST
>>-DQT_NO_COMPAT  -c -o kaccelmanager.lo `test -f 'kaccelmanager.cpp' ||
>>echo './'`kaccelmanager.cpp
>>"../kdecore/kdebug.h", line 219: Warning: d hides kdbgstream::d.
>>    
>>
>
>This is where the actual error starts:
>
>  
>
>>"kaccelmanager.cpp", line 112: Error:
>>KAcceleratorManagerPrivate::ItemList is not accessible from
>>KAcceleratorManagerPrivate::Item.
>>"kaccelmanager.cpp", line 139: Error:
>>KAcceleratorManagerPrivate::ItemList is not accessible from
>>KAcceleratorManagerPrivate::Item::addChild(KAcceleratorManagerPrivate::Item*).
>>2 Error(s) and 1 Warning(s) detected.
>>make[3]: *** [kaccelmanager.lo] Error 1
>>make[3]: Leaving directory `/usr/share/src/build/kderc/kdelibs-3.0.99/kdeui'
>>make[2]: *** [all-recursive] Error 1
>>make[2]: Leaving directory `/usr/share/src/build/kderc/kdelibs-3.0.99/kdeui'
>>make[1]: *** [all-recursive] Error 1
>>make[1]: Leaving directory `/usr/share/src/build/kderc/kdelibs-3.0.99'
>>make: *** [all] Error 2
>>
>>The error location (kaccelmanager.cpp:112) is within the delcaration of
>>KAcceleratorManagerPrivate::ItemList.  ItemList is a typedef'd QPtrList
>>containing <Item> objects, but Item is declared as a private inner
>>class, which itself refers to an ItemList.  I am not sure what the
>>resolution rules are in this case, but at first glance this seems to me
>>to be a circular reference (??).
>>    
>>
>
>Close, at least, that's what I think. Since the declaration is private,
>any other objects will have no access to it, even if they are embedded.
>The declaration should be protected instead of private.
>
>Here's the relevant part:
>
>=============================================
>class KAcceleratorManagerPrivate
>{
>public:
>
>[...]
>
>private:
>  class Item;
>  typedef QPtrList<Item> ItemList;
>
>[...]
>
>  class Item
>  {
>  public:
>
>[...]
>
>    void addChild(Item *item);
>
>=============================================
>
>Can you change the "private" to "protected"? If that works, it's either
>that the g++ compiler is too lax, or that the SunOne compiler is too
>strict. I don't have time to look up the exact rules :)
>
>Wout.
>
>PS: Can I get that compiler from somewhere? I'd like to give the
>compilation a try. I hope that it will result in a faster KDE...
>
>___________________________________________________
>This message is from the kde-solaris mailing list.
>Account management:  http://mail.kde.org/mailman/listinfo/kde-solaris.
>Archives: http://lists.kde.org/.
>More info: http://www.kde.org/faq.html.
>
>  
>

-- 
============================================================
 Cory C. Omand - Test Engineer    Access Line: 510.315.5959
 Sun Microsystems                         Fax: 510.315.5959
 Newark, CA USA
============================================================