lua-stringy
lua-stringy copied to clipboard
Symbol not found: _fastsearch
I'm seeing this on luajit on El Capitan:
|| lua: error loading module 'stringy' from file '/Users/jdonaldson/env/lib/lua/5.1/stringy.so':
|| dlopen(/Users/jdonaldson/env/lib/lua/5.1/stringy.so, 6): Symbol not found: _fastsearch
|| Referenced from: /Users/jdonaldson/env/lib/lua/5.1/stringy.so
|| Expected in: flat namespace
|| in /Users/jdonaldson/env/lib/lua/5.1/stringy.so
|| stack traceback:
|| [C]: at 0x010006c150
|| [C]: in function 'require'
out.lua|54 info| in main chunk
|| [C]: at 0x0100001580
|| Error: Command failed with error 1
It works if I downgrade to 0.2-1 That was suggested by these related articles : https://github.com/Kong/kong/issues/213 https://github.com/Kong/kong/issues/1736
I updated to a version 0.5-0 that attempts to explicitly include the fastsearch.h header. I built this a long time ago and haven't done much with lua and especially not lua rocks. If you could test and verify that v0.5-0 works, I'll try to get it into luarocks.org (I can't even remember how to do that). Otherwise, I'm open to any suggestions on how to fix.
ping @jdonaldson
Thanks for preparing a release. I'm hitting some env problems with my macos environment. A missing size_t implies I'm missing stddef.h, but that's not the case. I'm stuck here, any ideas?
14:33 $ luarocks make stringy/stringy-0.5-0.rockspec > output.txt
In file included from stringy/stringy.c:14:
stringy/fastsearch.h:111:23: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
for (i = w; i >= 0; i--) {
~ ^ ~
1 warning generated.
stringy/fastsearch.h:20:8: error: unknown type name 'size_t'
inline size_t fastsearch(const char* string, size_t slen,
^
[... yadda ...]
Error: Build error: Failed compiling object stringy/fastsearch.o
I pushed a new release: 0.5-1. could you try that? thanks.
Cool, looks like some progress. I can build and install successfully. That warning on fastsearch is there, but it's probably not worth messing with.
I can't load the library in lua though:
18:36 $ lua5.1 -lstringy
lua5.1: error loading module 'stringy' from file './stringy.so':
dlopen(./stringy.so, 2): Symbol not found: _fastsearch
Referenced from: ./stringy.so
Expected in: flat namespace
in ./stringy.so
stack traceback:
[C]: ?
[C]: ?
[C]: ?
lua: error loading module 'stringy' from file '/usr/local/lib/lua/5.3/stringy.so': dlopen(/usr/local/lib/lua/5.3/stringy.so, 6): Symbol not found: _fastsearch Referenced from: /usr/local/lib/lua/5.3/stringy.so Expected in: flat namespace in /usr/local/lib/lua/5.3/stringy.so stack traceback: [C]: in ? [C]: in function 'require' helloword.lua:2: in main chunk [C]: in ?