-
Notifications
You must be signed in to change notification settings - Fork 70
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
I got an error for luacrypto.c #37
Comments
Which gcc version is that? |
I have the gcc-4.9.2-6.fc21.x86_64 one. |
Just tested on Debian jessie (gcc 4.9.2) and I don't get that errors.
I don't know Fedora much. What version of Lua are you using? Did you install it from a package or did you compile it yourself? I'm suspecting this might be related to having compiled Lua 5.2 with LUA_COMPAT_MODULE disabled. |
I got lua-5.2.2-8.fc21.x86_64 from package. Maybe I have to compile it actually... I also installed lua-devel-5.2.2-8.fc21.x86_64 with yum. Also try "sudo luarocks install luacrypto" but I got this (I don't know why before doesn't share full log):
|
Ok. I see what is going on. The thing is that Fedora adds If you open lauxlib.h you'll see at then that when compat mode is enabled, a stub for So I think the correct code would be: #if LUA_VERSION_NUM >= 502
#if !defined(LUA_COMPAT_MODULE)
static void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l)
{
if (libname) lua_newtable(L);
luaL_setfuncs(L, l, 0);
}
#endif
#ifndef lua_objlen
#define lua_objlen lua_rawlen
#endif
#endif So we could say that LuaCrypto can't be installed with Fedora Core 21. Could you change the issue description? I would provide a pull request for this, but this project seems abandoned, sadly. |
Where I add that code? in lauxlib.h? and where? You say "The thing is that Fedora adds #define LUA_COMPAT_ALL to luaconf.h and Debian does not." what does this means? Please be a little more pedagogic. And please can you provide me a fast solution to go around the problem? And what title do you want? Tell me and I change it... |
Sorry. I was in a rush before. The code should be added in luacrypto.c, replacing these lines. The thing about Fedora adding LUA_COMPAT_ALL was a remark on the difference between Linux distros and how they "package" certain software (Lua in this case). Fedora builds Lua in such a way that triggers this error you found. Debian does not. That is why I couldn't reproduce your error in my development environment. The suggested title for this issue would be just "Fails to compile with Fedora Core 21" As for a fast solution... luarocks unpack luacrypto
cd luacrypto-0.3.2.-1/luacrypto-0.3.2
(edit src/lcrypto.c and change the code as suggested in the previous comment)
luarocks make luacrypto-0.3.2-1.rockspec I hope this helps. |
I do it but still same problem....:( |
When does the problem appear now? When you do |
Yes, excuse: This is the file https://gist.github.com/cryptid11/89bf0c6cc3ad90b17445 When I execute "luarocks make luacrypto-0.3.2-1.rockspec": Before I got:
Then retrying magically I got "luacrypto 0.3.2-1 is now built and installed in /usr (license: MIT)" But when I retry compile the program I got:
|
What do you mean by "retry compile"? Are you installing luacrypto explicitly or is it a dependency of another Lua rock? I'm installing Fedora 21 right now so I can see the problem myself. |
Well, I managed to install luacrypto using the steps I mentioned.
Now, please tell me if you still have problems after following those steps. If you now install something that depends on luacrypto, it should pick up the rock you've just installed. Hope this helps. |
Yes, I told you I also got "luacrypto 0.3.2-1 is now built and installed in /usr (license: MIT)" after a first (mine it seems) error. But when trying to install https://github.com/yagop/telegram-bot I got the same result... So, if it doesn't depend on luacrypto and gcc I wonder why I got this error. Maybe it doesn't "see" my installation because at a certain poit it says:
Do you have any hypothesis? |
Having described the whole picture earlier would have saved a lot of time 😄 To work around this issue, you can do the following. You can pack your installed luacrypto, modify the telegram-bot installation script and install luacrypto before this line To pack the rock, do luarocks install can take a /path/to/your/rock so take note of that when editing telegram-bot's install script.
|
I did
|
Same issue here. Works fine on alpine linux but failed on debian and ubuntu. (latest version) |
just do |
Same problem, but solved finally. go pull codes from https://github.com/evanlabs/luacrypto, which fixed openssl compatibility problems,
make && make install done! |
https://github.com/mkottman/luacrypto/blob/master/src/lcrypto.c
When I compile using that library I get:
gcc -O2 -fPIC -I/usr/include -c src/lcrypto.c -o src/lcrypto.o -I/usr/include
In file included from src/lcrypto.c:31:0:
src/lcrypto.c:38:13: error: expected declaration specifiers or ‘...’ before ‘(’ token
static void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l)
The text was updated successfully, but these errors were encountered: