Skip to content

make error #6

@867380699

Description

@867380699
cd build ; lua ../src/gen_c_header.lua ../dict/flypy.dict
cd build ; lua ../src/gen_c_entry.lua libflypy
gcc -shared -fPIC -llua -Ibuild -Isrc build/libflypy.c src/dict.c -o build/libflypy.so
In file included from src/dict.c:4:
build/dict.h:5:5: error: unknown type name ‘uint32_t’
    5 |     uint32_t next;
      |     ^~~~~~~~
build/dict.h:6:5: error: unknown type name ‘uint8_t’
    6 |     uint8_t is_list;
      |     ^~~~~~~
build/dict.h:7:5: error: unknown type name ‘uint8_t’
    7 |     uint8_t frequency;
      |     ^~~~~~~
src/dict.c:8:49: error: unknown type name ‘uint32_t’
    8 | typedef void (*QUERY_ITEM_HANDLE)(lua_State *L, uint32_t hash, const char *code);
      |                                                 ^~~~~~~~
src/dict.c:6:1: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
    5 | #include "query.h"
  +++ |+#include <stdint.h>
    6 | 
src/dict.c:10:45: error: unknown type name ‘uint32_t’
   10 | static void add_dict_as_table(lua_State *L, uint32_t hash, const char *code)
      |                                             ^~~~~~~~
src/dict.c:10:45: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
src/dict.c: In function ‘get_hash_by_code’:
src/dict.c:28:5: error: unknown type name ‘uint32_t’
   28 |     uint32_t hash = 0;
      |     ^~~~~~~~
src/dict.c:28:5: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
src/dict.c:35:18: error: ‘uint32_t’ undeclared (first use in this function)
   35 |         hash += (uint32_t)((code[i] - 'a' + 1) * pow(27, i));
      |                  ^~~~~~~~
src/dict.c:35:18: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
src/dict.c:35:18: note: each undeclared identifier is reported only once for each function it appears in
src/dict.c: At top level:
src/dict.c:40:47: error: unknown type name ‘uint32_t’
   40 | static int query_items_by_hash(lua_State *L,  uint32_t hash, QUERY_ITEM_HANDLE item_handle, const char *code)
      |                                               ^~~~~~~~
src/dict.c:40:47: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
src/dict.c:40:62: error: unknown type name ‘QUERY_ITEM_HANDLE’
   40 | static int query_items_by_hash(lua_State *L,  uint32_t hash, QUERY_ITEM_HANDLE item_handle, const char *code)
      |                                                              ^~~~~~~~~~~~~~~~~
src/dict.c: In function ‘query’:
src/dict.c:63:5: error: unknown type name ‘uint32_t’
   63 |     uint32_t    return_cnt     = 0;
      |     ^~~~~~~~
src/dict.c:63:5: note: ‘uint32_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
src/dict.c:71:23: warning: implicit declaration of function ‘query_items_by_hash’ [-Wimplicit-function-declaration]
   71 |         return_cnt += query_items_by_hash(L, get_hash_by_code(code), add_dict_as_table, code);
      |                       ^~~~~~~~~~~~~~~~~~~
src/dict.c:71:70: error: ‘add_dict_as_table’ undeclared (first use in this function)
   71 |         return_cnt += query_items_by_hash(L, get_hash_by_code(code), add_dict_as_table, code);
      |                                                                      ^~~~~~~~~~~~~~~~~
make: *** [Makefile:15: build/libflypy.so] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions