Giter Club home page Giter Club logo

fleece-lite's People

Contributors

eonblast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

guozanhua

fleece-lite's Issues

Compile in OSX

Hello.

To compile 'make macosx' I had to copy lua headers to include folder.

When i try to run my test code in Lua 5.1.5 I get an error:

lua: error loading module 'fleece' from file 'bin/OSX/fleece.so':
dlopen(bin/OSX/fleece.so, 2): Symbol not found: _buffer_add
Referenced from: bin/OSX/fleece.so
Expected in: flat namespace
in bin/OSX/fleece.so

When I try to tun it with Luajit 2.1 I get this error:

luajit: error loading module 'fleece' from file 'bin/OSX/fleece.so':
dlopen(bin/OSX/fleece.so, 6): Symbol not found: luaO_nilobject
Referenced from: bin/OSX/fleece.so
Expected in: flat namespace
in bin/OSX/fleece.so

Compilation errors on macosx

I have lua 5.2 installed on a mac. git-cloned fleece-lite. Run 'make macosx' from fleece dir.
Get these errors:
(cd src && /Applications/Xcode.app/Contents/Developer/usr/bin/make macosx)
gcc -Wall -bundle -undefined dynamic_lookup -I../include -o fleece.so fleece.c
In file included from fleece.c:33:
In file included from ../include/lobject.h:15:
../include/llimits.h:18:9: error: unknown type name 'LUAI_UINT32'
typedef LUAI_UINT32 lu_int32;
^
../include/llimits.h:47:9: error: unknown type name 'LUAI_USER_ALIGNMENT_T'
typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
^
In file included from fleece.c:33:
../include/lobject.h:365:1: error: unknown type name 'LUAI_DATA'
LUAI_DATA const TValue luaO_nilobject_;
^
../include/lobject.h:365:11: error: expected identifier or '('
LUAI_DATA const TValue luaO_nilobject_;
^
In file included from fleece.c:36:
/usr/local/include/lauxlib.h:46:25: error: function cannot return function type 'int (lua_State _, int)'
LUALIB_API lua_Unsigned (luaL_checkunsigned) (lua_State *L, int numArg);
^
/usr/local/include/lauxlib.h:46:26: error: a parameter list without types is only allowed in a function definition
LUALIB_API lua_Unsigned (luaL_checkunsigned) (lua_State *L, int numArg);
^
/usr/local/include/lauxlib.h:48:45: error: unknown type name 'lua_Unsigned'; did you mean 'unsigned'?
lua_Unsigned def);
^
/usr/local/include/lauxlib.h:47:25: error: function cannot return function type 'int (lua_State *, int, unsigned int)'
LUALIB_API lua_Unsigned (luaL_optunsigned) (lua_State *L, int numArg,
^
/usr/local/include/lauxlib.h:47:26: error: a parameter list without types is only allowed in a function definition
LUALIB_API lua_Unsigned (luaL_optunsigned) (lua_State *L, int numArg,
^
In file included from fleece.c:38:
In file included from ../include/ldebug.h:11:
In file included from ../include/lstate.h:13:
../include/ltm.h:46:1: error: unknown type name 'LUAI_DATA'
LUAI_DATA const char *const luaT_typenames[];
^
../include/ltm.h:46:11: error: expected identifier or '('
LUAI_DATA const char *const luaT_typenames[];
^
In file included from fleece.c:45:
In file included from ./fleece-intern.h:35:
./fleece-buffers.h:187:57: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
inline void add_fix_part(string_part *_last, const char const add, size_t len, size_t *total_len,
^
In file included from fleece.c:52:
./fleece-numbers.c:316:13: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *g = (const char const *)f;
^
./fleece-numbers.c:316:36: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const char const *g = (const char const *)f;
^
./fleece-numbers.c:318:27: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
if(strstr(g, (const char const *)&x) != 0)
^
In file included from fleece.c:55:
./fleece-lua.c:57:2: warning: implicit declaration of function 'luaL_register' is invalid in C99 [-Wimplicit-function-declaration]
luaL_register(L, "fleece", fleece); /
registering the module */
^
./fleece-lua.c:191:5: warning: implicit declaration of function 'luai_apicheck' is invalid in C99 [-Wimplicit-function-declaration]
api_check(L, idx <= L->ci->top - L->base);
^
../include/llimits.h:64:20: note: expanded from macro 'api_check'

define api_check luai_apicheck

                            ^

In file included from fleece.c:55:
./fleece-lua.c:192:44: error: use of undeclared identifier 'luaO_nilobject_'
if (o >= L->top) return cast(TValue *, luaO_nilobject);
^
../include/lobject.h:363:27: note: expanded from macro 'luaO_nilobject'

define luaO_nilobject (&luaO_nilobject_)

                              ^

../include/llimits.h:75:27: note: expanded from macro 'cast'

define cast(t, exp) ((t)(exp))

                         ^

In file included from fleece.c:55:
./fleece-lua.c:212:34: error: use of undeclared identifier 'luaO_nilobject_'
: cast(TValue *, luaO_nilobject);
^
../include/lobject.h:363:27: note: expanded from macro 'luaO_nilobject'

define luaO_nilobject (&luaO_nilobject_)

                              ^

../include/llimits.h:75:27: note: expanded from macro 'cast'

define cast(t, exp) ((t)(exp))

                         ^

6 warnings and 13 errors generated.
make[1]: *** [macosx] Error 1
make: *** [macosx] Error 2

Result is [typeless data] in luajit environment

-- test.lua
local fleece = require "fleece"
local tbl    = {1,2,3}
local result = fleece.json(tbl)

print(result)

It works just fine by /usr/bin/lua :

$ lua test.lua
$ [1,2,3]

However, it shows [typeless data] when it comes to luajit:

$ luajit test.lua
$ [typeless data]

The version of lua and luajit is:

$ luajit -v
$ LuaJIT 2.0.2 -- Copyright (C) 2005-2013 Mike Pall. http://luajit.org/
$
$ lua -v
$ Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio

Does anyone know how to solve this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.