zoukankan      html  css  js  c++  java
  • Lua require搜索路径指定方法

    在自己的lua文件中,如果使用到了自己写的C库或者第三方库,想让lua编译到自己指定的目录下寻找*.lua或*。so文件的时候,可以再自己的Lua代码中添加如下代码,可以指定require搜索的路径。 

        package.path = '/usr/local/share/lua/5.1/?.lua;/home/resty/?.lua;'    --搜索lua模块
        package.cpath = '/usr/local/lib/lua/5.1/?.so;'        --搜索so模块

    如果是要在 nginx.conf 文件中引用第三方的库,则需要在 http 段中添加下面的代码

        lua_package_path '/usr/local/share/lua/5.1/?.lua;/home/resty/?.lua;';
        lua_package_cpath '/usr/local/lib/lua/5.1/?.so;';

    详细内容请参考:http://www.jb51.net/article/55818.htm

  • 相关阅读:
    老陈与小石头运算代码
    第五次作业
    老陈与小石头
    简易四则运算
    四则运算
    对git的认识
    第一次作业
    arcgis-tomcat-cors
    jquery deferred promise
    springloaded hot deploy
  • 原文地址:https://www.cnblogs.com/foundwant/p/4185200.html
Copyright © 2011-2022 走看看