質問編集履歴

1

エラーメッセージを追加しました

2020/06/14 14:16

投稿

rft3
rft3

スコア7

test CHANGED
File without changes
test CHANGED
@@ -191,3 +191,99 @@
191
191
  ```
192
192
 
193
193
  ```
194
+
195
+ エラーメッセージ
196
+
197
+ In file included from cpgm/distance.c:4:0:
198
+
199
+ cpgm/queue.h: In function ‘init_queue’:
200
+
201
+ cpgm/queue.h:8:39: error: incompatible type for argument 1 of ‘calloc’
202
+
203
+ queue->nodes_ptr = (Node **) calloc(n, sizeof(N
204
+
205
+ ^
206
+
207
+ In file included from cpgm/distance.c:2:0:
208
+
209
+ /usr/include/stdlib.h:468:14: note: expected ‘size_t {aka long unsigned int}’ but argument is of type ‘Node {aka struct <anonymous>}’
210
+
211
+ extern void *calloc (size_t __nmemb, size_t __s
212
+
213
+ ^
214
+
215
+ In file included from cpgm/distance.c:4:0:
216
+
217
+ cpgm/queue.h: In function ‘enq’:
218
+
219
+ cpgm/queue.h:14:8: error: invalid type argument of ‘->’ (have ‘Queue {aka struct <anonymous>}’)
220
+
221
+ queue->arr[queue->last++] = input;
222
+
223
+ ^
224
+
225
+ cpgm/queue.h:14:19: error: invalid type argument of ‘->’ (have ‘Queue {aka struct <anonymous>}’)
226
+
227
+ queue->arr[queue->last++] = input;
228
+
229
+ ^
230
+
231
+ cpgm/queue.h:14:31: error: ‘input’ undeclared (first use in this function)
232
+
233
+ queue->arr[queue->last++] = input;
234
+
235
+ ^
236
+
237
+ cpgm/queue.h:14:31: note: each undeclared identifier is reported only once for each function it appears in
238
+
239
+ cpgm/queue.h: In function ‘deq’:
240
+
241
+ cpgm/queue.h:18:3: error: unknown type name ‘nodes_ptr’
242
+
243
+ nodes_ptr output = queue->arr[queue->first++]
244
+
245
+ ^
246
+
247
+ cpgm/queue.h:18:27: error: ‘Queue {aka struct <anonymous>}’ has no member named ‘arr’
248
+
249
+ nodes_ptr output = queue->arr[queue->first++]
250
+
251
+ ^
252
+
253
+ cpgm/distance.c: In function ‘init_value’:
254
+
255
+ cpgm/distance.c:15:22: error: incompatible type for argument 2 of ‘init_queue’
256
+
257
+ init_queue(&queue, N);
258
+
259
+ ^
260
+
261
+ In file included from cpgm/distance.c:4:0:
262
+
263
+ cpgm/queue.h:7:6: note: expected ‘Node {aka struct <anonymous>}’ but argument is of type ‘int’
264
+
265
+ void init_queue(Queue *queue, Node n){
266
+
267
+ ^
268
+
269
+ cpgm/distance.c: At top level:
270
+
271
+ cpgm/distance.c:18:20: error: expected declaration specifiers or ‘...’ before ‘nodes_ptr’
272
+
273
+ void calc_distance(nodes_ptr origin){
274
+
275
+ ^
276
+
277
+ cpgm/distance.c: In function ‘print_distance’:
278
+
279
+ cpgm/distance.c:63:30: error: subscripted value is neither array nor pointer nor vector
280
+
281
+ fprintf(fp, "%s ", name[hashM[d][j]]);
282
+
283
+ ^
284
+
285
+ cpgm/distance.c: In function ‘main’:
286
+
287
+ cpgm/distance.c:74:14: warning: implicit declaration of function ‘calc_distance’ [-Wimplicit-function-declaration]
288
+
289
+ int maxD = calc_distance(origin);