home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!tulane!uflorida!usf.edu!racquet!roberts
- From: roberts@racquet.csee.usf.edu (Chris Roberts)
- Newsgroups: comp.lang.c++
- Subject: Advice on GNU C++ container class prototypes
- Message-ID: <1992Nov4.181225.27735@ariel.ec.usf.edu>
- Date: 4 Nov 92 18:12:25 GMT
- Sender: news@ariel.ec.usf.edu (News Admin)
- Reply-To: roberts@racquet.csee.usf.edu (Chris Roberts)
- Organization: University of South Florida, Department of Computer Science and Engineering
- Lines: 200
-
-
- **** Any advice would be extremely helpful ****
-
- I am quite new to GNU C++, and discovered that GNU C++ had some
- facility for generating classes in any type, defined for a large suite
- of data structures. In particular, I have been trying to use this
- facility (called /usr/local/bin/genclass) to generate a List of
- Strings. Among others, the List class prototypes are found under
- /usr/local/lib/g++-include/gen/List.(ccP|hP), and the String class is
- found under /usr/local/lib/g++-include/String.h.
-
- The command that I used to generate this class was:
-
- genclass String val List
-
- But after generation, I tried to compile this with a very simple main
- program only consisting of main(){} and got many errors (which are
- listed below) when I typed:
-
- g++ -c -g -I/usr/local/lib/g++-include -Wall main.cc String.List.cc
-
- I was wondering if any of you had any experience using these class
- prototypes, and if you could clue my in on what went wrong.
-
- Thanx-
-
- Chris Roberts
- (roberts@racquet.csee.usf.edu)
-
-
- List of errors:
- --------------
- In file included from String.List.cc:28:
- String.List.h:33: `String' undeclared, outside of functions
- String.List.h:34: `StringMapper' undeclared, outside of functions
- String.List.h:34: `String' undeclared, outside of functions
- String.List.h:34: `String' declared as function returning a function
- String.List.h:35: `StringCombiner' declared as function returning a function
- In file included from String.List.cc:28:
- String.List.h:75: cannot declare references to functions; use pointer to
- function instead
- String.List.h:76: cannot declare references to functions; use pointer to
- function instead
- String.List.h:77: cannot declare references to functions; use pointer to
- function instead
- String.List.h:92: `StringMapper' undeclared, outside of functions
- String.List.h:92: parse error before `f'
- String.List.h:102: `pop' declared as function returning a function
- String.List.h:115: `reduce' declared as function returning a function
- String.List.h:123: cannot declare references to functions; use pointer
- to function instead
- String.List.cc: In method class StringList &StringList::operator =
- (class StringList &):
- String.List.cc:46: warning: implicit declaration of function
- `reference'
- String.List.cc:47: warning: implicit declaration of function
- `dereference'
- String.List.cc: At top level:
- String.List.cc:53: `pop' declared as function returning a function
- String.List.cc: In method int StringList::pop ():
- String.List.cc:54: function `res__Fe' is initialized like a variable
- String.List.cc:59: warning: return of integer from pointer lacks a cast
- String.List.cc: At top level:
- String.List.cc:106: cannot declare references to functions; use pointer
- to function instead
- String.List.cc: In method int (*StringList::operator [] (int))():
- String.List.cc:108: return between incompatible pointer types
- String.List.cc:109: warning: control reaches end of non-void function
- String.List.cc: In method void StringList::subst (auto int (*)(), auto
- int (*)()):
- String.List.cc:142: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc:143: invalid lvalue in assignment
- String.List.cc: At top level:
- String.List.cc:147: `reduce' declared as function returning a function
- String.List.cc: In method int StringList::reduce (auto int (*)(auto int
- (*)(),auto int (*)()), aut
- o int (*)()):
- String.List.cc:148: function `r__Fe' is initialized like a variable
- String.List.cc:150: invalid lvalue in assignment
- String.List.cc:151: warning: return of integer from pointer lacks a
- cast
- String.List.cc: In method int StringList::position (auto int (*)()):
- String.List.cc:162: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc: In method int StringList::contains (auto int (*)()):
- String.List.cc:179: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc: In method class StringList StringList::find (auto int
- (*)()):
- String.List.cc:188: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc: In method void *StringList::seek (auto int (*)()):
- String.List.cc:200: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc: In method void StringList::del (auto int (*)()):
- String.List.cc:297: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc:312: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc: In function class StringList copy (class StringList &):
- String.List.cc:434: warning: implicit declaration of function
- `newStringListNode'
- String.List.cc:434: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc:438: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: In function class StringList subst (auto int (*)(), auto
- int (*)(), class StringLi
- st &):
- String.List.cc:457: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc:458: invalid lvalue in assignment
- String.List.cc:460: invalid lvalue in assignment
- String.List.cc:466: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc:467: invalid lvalue in assignment
- String.List.cc:469: invalid lvalue in assignment
- String.List.cc: In function class StringList combine (auto int (*)(auto
- int (*)(),auto int (*)()),
- class StringList &, class StringList &):
- String.List.cc:486: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc:492: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: In function class StringList reverse (class StringList
- &):
- String.List.cc:510: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc:514: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: In function class StringList append (class StringList &,
- class StringList &):
- String.List.cc:529: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc:533: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: In method void StringList::prepend (class StringList
- &):
- String.List.cc:549: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc:553: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: In function class StringList concat (class StringList &,
- class StringList &):
- String.List.cc:568: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc:572: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc:578: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc:587: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc:591: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: In function class StringList select (auto int (*)(auto
- int (*)()), class StringLis
- t &):
- String.List.cc:610: warning: assignment of pointer from integer lacks a
- cast
- String.List.cc:616: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: In function class StringList remove (auto int (*)(auto
- int (*)()), class StringLis
- t &):
- String.List.cc:638: warning: assignment of pointer from integer lacks a
- cast
- String.List.cc:644: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: In function class StringList remove (auto int (*)(),
- class StringList &):
- String.List.cc:664: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc:666: warning: assignment of pointer from integer lacks a
- cast
- String.List.cc:670: warning: comparison of distinct pointer types lacks
- a cast
- String.List.cc:672: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: At top level:
- String.List.cc:686: `StringMapper' undeclared, outside of functions
- String.List.cc:686: parse error before `f'
- String.List.cc: In function class StringList map (...):
- String.List.cc:688: `x' undeclared (first use this function)
- String.List.cc:688: (Each undeclared identifier is reported only once
- String.List.cc:688: for each function it appears in.)
- String.List.cc:692: `f' undeclared (first use this function)
- String.List.cc:692: warning: assignment of pointer from integer lacks a
- cast
- String.List.cc:696: warning: initialization of pointer from integer
- lacks a cast
- String.List.cc: In function class StringList merge (class StringList &,
- class StringList &, auto i
- nt (*)(auto int (*)(),auto int (*)())):
- String.List.cc:725: invalid lvalue in assignment
- String.List.cc:730: invalid lvalue in assignment
- String.List.cc:744: invalid lvalue in assignment
- String.List.cc:758: invalid lvalue in assignment
- String.List.cc:770: invalid lvalue in assignment
- String.List.cc:779: invalid lvalue in assignment
-