Can't require lua-cjson #471
              
                Unanswered
              
          
                  
                    
                      Hammad1029
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment
-
| 
         gopher-lua doesn't support loading C libraries: https://github.com/yuin/gopher-lua/blob/master/loadlib.go#L12 Compare to upstream lua's _LOADERS If you need a specific C library you can wrap its interface in go (either with cgo, or by reimplementing c library in go) & then expose that to your application as a preloaded library  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I have a lua script that imports lua-cjson
require("cjson")What ever I do, running this script using gopher-lua returns:
no field package.preload['cjson'] stat ./cjson.lua: no such file or directory stat /usr/local/share/lua/5.1/cjson.lua: no such file or directory stat /usr/local/share/lua/5.1/cjson/init.lua: no such file or directory,while running the script using the standard shell using
lua script.luaruns fineBeta Was this translation helpful? Give feedback.
All reactions