Error when compiling under Solaris

E

etienne

Hello,

I'm trying to compile this C++ code with gcc 3.4.5 under Solaris/SPARC
(from a complete application, the file is : FullLinkedList.hh) but the
make fails (no problem when compiling under ubuntu/x86) :

(from line 330 to 481)
/*****************************************************************************
* ITERATOR SECTION - INNER CLASSES

****************************************************************************/
public:
/**
* Allows readaccess to the linked list. Several readers
* can exist parallel, but no writer will disturb the
* reading. The iterators lock on the list will be removed
* when the iterator is deleted.
*/
class ReadIterator
{
// these two are necessary for the private constructors
friend class FullLinkedList;

/***************************************************************************
* PUBLIC METHODS

**************************************************************************/
public:
// Many methods here but not interesting for my problem I think


/***************************************************************************
* PROTECTED METHODS

**************************************************************************/
protected:
// Many methods here but not interesting for my problem I think


/***************************************************************************
* PROTECTED FIELDS

**************************************************************************/
protected:
/**
* contains the linked list this iterator controlls
*/
FullLinkedList* linkedList;

/**
* the current Node of the iterator
*/
// HERE IS THE ERROR - LINE 468 :
FullLinkedList::Node* currentNode;

/**
*
*/
bool noReadRelease;

}; // End inner class ReadIterator



make prints this error message :

[macareux] /home/inh25/diet/LogService-2.1.0>make
Making all in src
make[1]: Entering directory `/home/inh25/diet/LogService-2.1.0/src'
Making all in idl
make[2]: Entering directory `/home/inh25/diet/LogService-2.1.0/src/idl'
make all-am
make[3]: Entering directory `/home/inh25/diet/LogService-2.1.0/src/idl'
make[3]: Rien à faire pour « all-am ».
make[3]: Leaving directory `/home/inh25/diet/LogService-2.1.0/src/idl'
make[2]: Leaving directory `/home/inh25/diet/LogService-2.1.0/src/idl'
Making all in utils
make[2]: Entering directory
`/home/inh25/diet/LogService-2.1.0/src/utils'
make[2]: Rien à faire pour « all ».
make[2]: Leaving directory
`/home/inh25/diet/LogService-2.1.0/src/utils'
Making all in monitor
make[2]: Entering directory
`/home/inh25/diet/LogService-2.1.0/src/monitor'
if /bin/bash ../../libtool --tag=CXX --mode=compile g++
-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"LogService\"
-DVERSION=\"2.1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1
-DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -D__OMNIORB4__= -I. -I.
-I/usr/local/include -I/usr/local/include/omniORB4 -D_REENTRANT
-DUsePthread -DPthreadDraftVersion=10
-DPthreadSupportThreadPriority -I/usr/local -I/usr/local/include
-I/usr/local/include/omniORB4 -I../../src/idl -I../../src/utils
-I../../src/monitor -g -O2 -I/usr/local/include
-I/usr/local/include/omniORB4 -MT StateManager.lo -MD -MP -MF
".deps/StateManager.Tpo" -c -o StateManager.lo StateManager.cc; \
then mv -f ".deps/StateManager.Tpo" ".deps/StateManager.Plo"; else rm
-f ".deps/StateManager.Tpo"; exit 1; fi
g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"LogService\"
-DVERSION=\"2.1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1
-DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -D__OMNIORB4__= -I. -I.
-I/usr/local/include -I/usr/local/include/omniORB4 -D_REENTRANT
-DUsePthread -DPthreadDraftVersion=10 -DPthreadSupportThreadPriority
-I/usr/local -I/usr/local/include -I/usr/local/include/omniORB4
-I../../src/idl -I../../src/utils -I../../src/monitor -g -O2
-I/usr/local/include -I/usr/local/include/omniORB4 -MT StateManager.lo
-MD -MP -MF .deps/StateManager.Tpo -c StateManager.cc -fPIC -DPIC -o
..libs/StateManager.o
Dans le fichier inclus à partir de /usr/local/include/omniconfig.h:37,
à partir de /usr/local/include/omniORB4/CORBA_sysdep.h:106,
à partir de /usr/local/include/omniORB4/omniInternal.h:209,
à partir de /usr/local/include/omniORB4/CORBA.h:310,
à partir de ../../src/idl/LogTypes.hh:10,
à partir de StateManager.hh:48,
à partir de StateManager.cc:45:
/usr/local/include/omniORB4/acconfig.h:185:1: attention :
"PACKAGE_BUGREPORT" redefined
<ligne de commande>:5:1: attention : this is the location of the
previous definition
/usr/local/include/omniORB4/acconfig.h:188:1: attention :
"PACKAGE_NAME" redefined
<ligne de commande>:1:1: attention : this is the location of the
previous definition
/usr/local/include/omniORB4/acconfig.h:191:1: attention :
"PACKAGE_STRING" redefined
<ligne de commande>:4:1: attention : this is the location of the
previous definition
/usr/local/include/omniORB4/acconfig.h:194:1: attention :
"PACKAGE_TARNAME" redefined
<ligne de commande>:2:1: attention : this is the location of the
previous definition
/usr/local/include/omniORB4/acconfig.h:197:1: attention :
"PACKAGE_VERSION" redefined
<ligne de commande>:3:1: attention : this is the location of the
previous definition
In file included from ToolList.hh:49,
from StateManager.hh:50,
from StateManager.cc:45:
.../../src/utils/FullLinkedList.hh:468: erreur: expected `;' avant un
élément lexical « * »
In file included from ../../src/utils/FullLinkedList.hh:598,
from ToolList.hh:49,
from StateManager.hh:50,
from StateManager.cc:45:
.../../src/utils/FullLinkedList.cc: In constructor
`FullLinkedList<T>::ReadIterator::ReadIterator(FullLinkedList<T>*)':
.../../src/utils/FullLinkedList.cc:398: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `void
FullLinkedList<T>::ReadIterator::reset()':
.../../src/utils/FullLinkedList.cc:416: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `void
FullLinkedList<T>::ReadIterator::resetToLast()':
.../../src/utils/FullLinkedList.cc:423: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `bool
FullLinkedList<T>::ReadIterator::hasCurrent()':
.../../src/utils/FullLinkedList.cc:430: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `bool
FullLinkedList<T>::ReadIterator::hasNext()':
.../../src/utils/FullLinkedList.cc:437: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `bool
FullLinkedList<T>::ReadIterator::hasPrevious()':
.../../src/utils/FullLinkedList.cc:448: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `T*
FullLinkedList<T>::ReadIterator::getCurrent()':
.../../src/utils/FullLinkedList.cc:462: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `T*
FullLinkedList<T>::ReadIterator::getCurrentRef()':
.../../src/utils/FullLinkedList.cc:473: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `T*
FullLinkedList<T>::ReadIterator::next()':
.../../src/utils/FullLinkedList.cc:483: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `T*
FullLinkedList<T>::ReadIterator::nextRef()':
.../../src/utils/FullLinkedList.cc:495: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `T*
FullLinkedList<T>::ReadIterator::previous()':
.../../src/utils/FullLinkedList.cc:507: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `T*
FullLinkedList<T>::ReadIterator::previousRef()':
.../../src/utils/FullLinkedList.cc:519: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `T*
FullLinkedList<T>::Iterator::removeAndGetCurrent()':
.../../src/utils/FullLinkedList.cc:563: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc:566: erreur: il n'y a pas d'argument
à « hasCurrent » qui dépend d'un paramètre du patron, aussi une
déclaration de « hasCurrent » doit être disponible
.../../src/utils/FullLinkedList.cc:566: erreur: (si vous utilisez «
-fpermissive », G++ acceptera votre core, mais permettre l'utilisation
d'un nom non déclaré est obsolète)
.../../src/utils/FullLinkedList.cc:571: erreur: « linkedList » n'a pas
été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc:582: erreur: « linkedList » n'a pas
été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc:588: erreur: « linkedList » n'a pas
été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc:598: erreur: « linkedList » n'a pas
été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `void
FullLinkedList<T>::Iterator::insertAfterRef(T*)':
.../../src/utils/FullLinkedList.cc:618: erreur: « linkedList » n'a pas
été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc:623: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc:625: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In member function `void
FullLinkedList<T>::Iterator::insertBeforeRef(T*)':
.../../src/utils/FullLinkedList.cc:654: erreur: « linkedList » n'a pas
été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc:659: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc:661: erreur: « currentNode » n'a
pas été déclaré dans cet horizon
.../../src/utils/FullLinkedList.cc: In destructor
`FullLinkedList<T>::Iterator::~Iterator() [with T = log_msg_t]':
StateManager.cc:142: instantiated from here
.../../src/utils/FullLinkedList.cc:545: erreur: « linkedList » n'est
pas un membre de « FullLinkedList<log_msg_t> »
make[2]: *** [StateManager.lo] Erreur 1
make[2]: Leaving directory
`/home/inh25/diet/LogService-2.1.0/src/monitor'
make[1]: *** [all-recursive] Erreur 1
make[1]: Leaving directory `/home/inh25/diet/LogService-2.1.0/src'
make: *** [all-recursive] Erreur 1
[macareux] /home/inh25/diet/LogService-2.1.0>


thanks for your help, ask if I missed some details, Etienne
 
E

Earl Purple

etienne said:
I'm trying to compile this C++ code with gcc 3.4.5 under Solaris/SPARC
(from a complete application, the file is : FullLinkedList.hh) but the
make fails (no problem when compiling under ubuntu/x86) :
protected:
/**
* contains the linked list this iterator controlls
*/
FullLinkedList* linkedList;

/**
* the current Node of the iterator
*/
// HERE IS THE ERROR - LINE 468 :
FullLinkedList::Node* currentNode;

FullLinkedList<T>::ReadIterator::reset()':
../../src/utils/FullLinkedList.cc:416: erreur: « currentNode » n'a
pas été déclaré dans cet horizon

Just from this one error I can see that FullLinkedList is a template.
So perhaps you require a "typename" before your declaration (you
probably do).

You shouldn't make the members protected, by the way. What derived
classes are going to access them? Make them private.

Not sure if that compiler supports "export" but you probably want to
put the implementation together with the interface. You don't have to
put them in the same file but the header must include the
implementation file and neither go in the build. I prefer not to give
the implementation file a .cc (or equivalent) ending because that
confuses things (unless you use .cc only for template ones and .cpp say
for regular compilation units).
 
E

etienne

Thank you very much, the solution was to add typename, and curiously to
remove the include at the end of FullLinkedList.hh, it was quite
strange...But thanks for your help !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top