eonblast / fleece-lite Goto Github PK
View Code? Open in Web Editor NEWFast Lua to JSON
Home Page: http://eonblast.github.com/fleece-lite
License: Other
Fast Lua to JSON
Home Page: http://eonblast.github.com/fleece-lite
License: Other
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
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'
^
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'
^
../include/llimits.h:75:27: note: expanded from macro 'cast'
^
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'
^
../include/llimits.h:75:27: note: expanded from macro 'cast'
^
6 warnings and 13 errors generated.
make[1]: *** [macosx] Error 1
make: *** [macosx] Error 2
-- 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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.