Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol not found: _fastsearch #7

Open
jdonaldson opened this issue Dec 23, 2017 · 6 comments
Open

Symbol not found: _fastsearch #7

jdonaldson opened this issue Dec 23, 2017 · 6 comments

Comments

@jdonaldson
Copy link

jdonaldson commented Dec 23, 2017

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 :
Kong/kong#213
Kong/kong#1736

@brentp
Copy link
Owner

brentp commented Dec 23, 2017

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.

@brentp
Copy link
Owner

brentp commented Jan 4, 2018

ping @jdonaldson

@jdonaldson
Copy link
Author

jdonaldson commented Jan 4, 2018

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

@brentp
Copy link
Owner

brentp commented Jan 5, 2018

I pushed a new release: 0.5-1. could you try that? thanks.

@jdonaldson
Copy link
Author

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]: ?

@limingnihao
Copy link

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants