如何编译srlua? [英] How to compile srlua?

查看:48
本文介绍了如何编译srlua?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天制作了一个程序,我想知道如何使它可执行.我已经研究过,并且想出了使用srlua的方法.我之前曾问过这个问题,但是我通常会弄乱同一条指令.我被告知要编译srlua",尽管我确切地知道在编译srlua之后要做什么,但我现在不知道如何编译它们.

I made a program today, and I was wondering on how exactly to make it an executable. I've researched and I've came up with using srlua. I've asked this previously, but I usually mess up on the same instruction. I was told to 'compile srlua' While I know exactly what to do right after I compile srlua, I don't know how to compile them right now.

我已经看过一些YouTube教程,我设法找到了一个,但只能用西班牙语.在他下载了srlua的预编译版本之前,我可以稍作跟进,在他所在的页面上不再存在下载链接.

I've gone through a few YouTube tutorials, and I managed to find one but only in Spanish. I was able to slightly follow along until he downloaded a precompiled version of srlua, where the download link is no longer there at the same page he was at.

任何人都可以解释他们想说的话吗?

Would anyone be able to explain what they're trying to say?

推荐答案

您需要告诉CMake它所需的Lua文件在哪里.

You need to tell CMake where the Lua files it needs are.

对我来说,Lua包含在/usr/include/luaX.X 中,其中X.X是您的版本号,例如5.3.Lua库可能位于/usr/lib 中(文件名如 libluaX.X.so ).

For me, the Lua includes are in /usr/include/luaX.X, where X.X is your version number, e.g. 5.3. The Lua libraries may be in /usr/lib (with filenames like libluaX.X.so).

如果您的位置不同,可以尝试查找/|.grep"lua.h" find/|grep"liblua" .

If the locations differ for you, you can try find / | grep "lua.h" and find / | grep "liblua".

一旦找到了 lua.h 所在的文件夹以及相应的库文件(如 liblua5.3.so ),则需要将它们添加到srlua文件夹中的 CMakeLists.txt 文件.例如,使用lua5.3,您可以替换以下行:

Once you've located the folder which lua.h is in, and the appropriate library file like liblua5.3.so, you need to add these to the CMakeLists.txt file in the srlua folder. For example, using lua5.3, you might replace this line:

include_directories(${LUA_INCLUDE_DIR})

与此:

include_directories(/usr/include/lua5.3)

对于库,您可以替换为:

And for the libraries, you might replace this:

target_link_libraries(glue ${LUA_LIBRARIES})
target_link_libraries(srlua ${LUA_LIBRARIES})

与此:

target_link_libraries(glue /usr/lib/liblua5.3.so)
target_link_libraries(srlua /usr/lib/liblua5.3.so)

此后,在srlua文件夹中运行 cmake ./,然后运行 make .应该构建 srlua .

After this, run cmake ./ in the srlua folder, then run make. srlua should be built.

注意:您可能还必须删除 find_package(需要Lua)行,这对我来说是一个错误的错误(仅当我删除该行时才生成).

Note: you may also have to remove the line find_package ( Lua REQUIRED ), it was a false error for me (it only built when I removed that line).

这篇关于如何编译srlua?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆