home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 15954 < prev    next >
Encoding:
Text File  |  1992-11-09  |  8.9 KB  |  212 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!tulane!uflorida!usf.edu!racquet!roberts
  2. From: roberts@racquet.csee.usf.edu (Chris Roberts)
  3. Newsgroups: comp.lang.c++
  4. Subject: Advice on GNU C++ container class prototypes
  5. Message-ID: <1992Nov4.181225.27735@ariel.ec.usf.edu>
  6. Date: 4 Nov 92 18:12:25 GMT
  7. Sender: news@ariel.ec.usf.edu (News Admin)
  8. Reply-To: roberts@racquet.csee.usf.edu (Chris Roberts)
  9. Organization: University of South Florida, Department of Computer Science and Engineering
  10. Lines: 200
  11.  
  12.  
  13.            **** Any advice would be extremely helpful ****
  14.  
  15. I  am quite new to GNU   C++, and  discovered   that GNU  C++ had some
  16. facility for generating classes in any type, defined for a large suite
  17. of data structures.   In particular, I  have been  trying  to use this
  18. facility  (called  /usr/local/bin/genclass)  to generate  a   List  of
  19. Strings.   Among others,  the  List class prototypes  are found  under
  20. /usr/local/lib/g++-include/gen/List.(ccP|hP),  and the String class is
  21. found under /usr/local/lib/g++-include/String.h.
  22.  
  23. The command that I used to generate  this class was:
  24.  
  25. genclass String val List
  26.  
  27. But after generation, I tried to compile this with a  very simple main
  28. program  only consisting of  main(){} and got   many errors (which are
  29. listed below) when I typed:
  30.  
  31. g++ -c -g -I/usr/local/lib/g++-include -Wall main.cc String.List.cc
  32.  
  33. I was wondering  if  any  of you had  any experience using these class
  34. prototypes, and if you could clue my in on what went wrong.
  35.  
  36. Thanx-
  37.  
  38. Chris Roberts
  39. (roberts@racquet.csee.usf.edu)
  40.  
  41.  
  42. List of errors:
  43. --------------
  44. In file included from String.List.cc:28:
  45. String.List.h:33: `String' undeclared, outside of functions
  46. String.List.h:34: `StringMapper' undeclared, outside of functions
  47. String.List.h:34: `String' undeclared, outside of functions
  48. String.List.h:34: `String' declared as function returning a function
  49. String.List.h:35: `StringCombiner' declared as function returning a function
  50. In file included from String.List.cc:28:
  51. String.List.h:75: cannot declare references to functions; use pointer to
  52. function instead
  53. String.List.h:76: cannot declare references to functions; use pointer to
  54. function instead
  55. String.List.h:77: cannot declare references to functions; use pointer to
  56. function instead
  57. String.List.h:92: `StringMapper' undeclared, outside of functions
  58. String.List.h:92: parse error before `f'
  59. String.List.h:102: `pop' declared as function returning a function
  60. String.List.h:115: `reduce' declared as function returning a function
  61. String.List.h:123: cannot declare references to functions; use pointer
  62. to function instead
  63. String.List.cc: In method class StringList &StringList::operator =
  64. (class StringList &):
  65. String.List.cc:46: warning: implicit declaration of function
  66. `reference'
  67. String.List.cc:47: warning: implicit declaration of function
  68. `dereference'
  69. String.List.cc: At top level:
  70. String.List.cc:53: `pop' declared as function returning a function
  71. String.List.cc: In method int StringList::pop ():
  72. String.List.cc:54: function `res__Fe' is initialized like a variable
  73. String.List.cc:59: warning: return of integer from pointer lacks a cast
  74. String.List.cc: At top level:
  75. String.List.cc:106: cannot declare references to functions; use pointer
  76. to function instead
  77. String.List.cc: In method int (*StringList::operator [] (int))():
  78. String.List.cc:108: return between incompatible pointer types
  79. String.List.cc:109: warning: control reaches end of non-void function
  80. String.List.cc: In method void StringList::subst (auto int (*)(), auto
  81. int (*)()):
  82. String.List.cc:142: warning: comparison of distinct pointer types lacks
  83. a cast
  84. String.List.cc:143: invalid lvalue in assignment
  85. String.List.cc: At top level:
  86. String.List.cc:147: `reduce' declared as function returning a function
  87. String.List.cc: In method int StringList::reduce (auto int (*)(auto int
  88. (*)(),auto int (*)()), aut
  89. o int (*)()):
  90. String.List.cc:148: function `r__Fe' is initialized like a variable
  91. String.List.cc:150: invalid lvalue in assignment
  92. String.List.cc:151: warning: return of integer from pointer lacks a
  93. cast
  94. String.List.cc: In method int StringList::position (auto int (*)()):
  95. String.List.cc:162: warning: comparison of distinct pointer types lacks
  96. a cast
  97. String.List.cc: In method int StringList::contains (auto int (*)()):
  98. String.List.cc:179: warning: comparison of distinct pointer types lacks
  99. a cast
  100. String.List.cc: In method class StringList StringList::find (auto int
  101. (*)()):
  102. String.List.cc:188: warning: comparison of distinct pointer types lacks
  103. a cast
  104. String.List.cc: In method void *StringList::seek (auto int (*)()):
  105. String.List.cc:200: warning: comparison of distinct pointer types lacks
  106. a cast
  107. String.List.cc: In method void StringList::del (auto int (*)()):
  108. String.List.cc:297: warning: comparison of distinct pointer types lacks
  109. a cast
  110. String.List.cc:312: warning: comparison of distinct pointer types lacks
  111. a cast
  112. String.List.cc: In function class StringList copy (class StringList &):
  113. String.List.cc:434: warning: implicit declaration of function
  114. `newStringListNode'
  115. String.List.cc:434: warning: initialization of pointer from integer
  116. lacks a cast
  117. String.List.cc:438: warning: initialization of pointer from integer
  118. lacks a cast
  119. String.List.cc: In function class StringList subst (auto int (*)(), auto
  120. int (*)(), class StringLi
  121. st &):
  122. String.List.cc:457: warning: comparison of distinct pointer types lacks
  123. a cast
  124. String.List.cc:458: invalid lvalue in assignment
  125. String.List.cc:460: invalid lvalue in assignment
  126. String.List.cc:466: warning: comparison of distinct pointer types lacks
  127. a cast
  128. String.List.cc:467: invalid lvalue in assignment
  129. String.List.cc:469: invalid lvalue in assignment
  130. String.List.cc: In function class StringList combine (auto int (*)(auto
  131. int (*)(),auto int (*)()),
  132.  class StringList &, class StringList &):
  133. String.List.cc:486: warning: initialization of pointer from integer
  134. lacks a cast
  135. String.List.cc:492: warning: initialization of pointer from integer
  136. lacks a cast
  137. String.List.cc: In function class StringList reverse (class StringList
  138. &):
  139. String.List.cc:510: warning: initialization of pointer from integer
  140. lacks a cast
  141. String.List.cc:514: warning: initialization of pointer from integer
  142. lacks a cast
  143. String.List.cc: In function class StringList append (class StringList &,
  144. class StringList &):
  145. String.List.cc:529: warning: initialization of pointer from integer
  146. lacks a cast
  147. String.List.cc:533: warning: initialization of pointer from integer
  148. lacks a cast
  149. String.List.cc: In method void StringList::prepend (class StringList
  150. &):
  151. String.List.cc:549: warning: initialization of pointer from integer
  152. lacks a cast
  153. String.List.cc:553: warning: initialization of pointer from integer
  154. lacks a cast
  155. String.List.cc: In function class StringList concat (class StringList &,
  156. class StringList &):
  157. String.List.cc:568: warning: initialization of pointer from integer
  158. lacks a cast
  159. String.List.cc:572: warning: initialization of pointer from integer
  160. lacks a cast
  161. String.List.cc:578: warning: initialization of pointer from integer
  162. lacks a cast
  163. String.List.cc:587: warning: initialization of pointer from integer
  164. lacks a cast
  165. String.List.cc:591: warning: initialization of pointer from integer
  166. lacks a cast
  167. String.List.cc: In function class StringList select (auto int (*)(auto
  168. int (*)()), class StringLis
  169. t &):
  170. String.List.cc:610: warning: assignment of pointer from integer lacks a
  171. cast
  172. String.List.cc:616: warning: initialization of pointer from integer
  173. lacks a cast
  174. String.List.cc: In function class StringList remove (auto int (*)(auto
  175. int (*)()), class StringLis
  176. t &):
  177. String.List.cc:638: warning: assignment of pointer from integer lacks a
  178. cast
  179. String.List.cc:644: warning: initialization of pointer from integer
  180. lacks a cast
  181. String.List.cc: In function class StringList remove (auto int (*)(),
  182. class StringList &):
  183. String.List.cc:664: warning: comparison of distinct pointer types lacks
  184. a cast
  185. String.List.cc:666: warning: assignment of pointer from integer lacks a
  186. cast
  187. String.List.cc:670: warning: comparison of distinct pointer types lacks
  188. a cast
  189. String.List.cc:672: warning: initialization of pointer from integer
  190. lacks a cast
  191. String.List.cc: At top level:
  192. String.List.cc:686: `StringMapper' undeclared, outside of functions
  193. String.List.cc:686: parse error before `f'
  194. String.List.cc: In function class StringList map (...):
  195. String.List.cc:688: `x' undeclared (first use this function)
  196. String.List.cc:688: (Each undeclared identifier is reported only once
  197. String.List.cc:688: for each function it appears in.)
  198. String.List.cc:692: `f' undeclared (first use this function)
  199. String.List.cc:692: warning: assignment of pointer from integer lacks a
  200. cast
  201. String.List.cc:696: warning: initialization of pointer from integer
  202. lacks a cast
  203. String.List.cc: In function class StringList merge (class StringList &,
  204. class StringList &, auto i
  205. nt (*)(auto int (*)(),auto int (*)())):
  206. String.List.cc:725: invalid lvalue in assignment
  207. String.List.cc:730: invalid lvalue in assignment
  208. String.List.cc:744: invalid lvalue in assignment
  209. String.List.cc:758: invalid lvalue in assignment
  210. String.List.cc:770: invalid lvalue in assignment
  211. String.List.cc:779: invalid lvalue in assignment
  212.