Coder Social home page Coder Social logo

Error when requiring module about lua-curlv3 HOT 2 CLOSED

L3G5ND avatar L3G5ND commented on June 12, 2024
Error when requiring module

from lua-curlv3.

Comments (2)

JesseBrault0709 avatar JesseBrault0709 commented on June 12, 2024

I am also running into this error (not being able to find lcurl). I am installed on Mac OS 11.3 using homebrew/luarocks. To reproduce:

  1. brew install luarocks & brew install curl
  2. luarocks install lua-curl CURL_INCDIR=/opt/homebrew/opt/curl/include This produces the following:
Installing https://luarocks.org/lua-curl-0.3.13-1.src.rock

lua-curl 0.3.13-1 depends on lua >= 5.1, < 5.5 (5.4-1 provided by VM)
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/l52util.c -o src/l52util.o -I/opt/homebrew/opt/curl/include
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/lceasy.c -o src/lceasy.o -I/opt/homebrew/opt/curl/include
src/lceasy.c:203:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
src/lceasy.c:1512:31: warning: add explicit braces to avoid dangling else [-Wdangling-else]
        if(ret == 0) ret = 1; else ret = 0;
                              ^
2 warnings generated.
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/lcerror.c -o src/lcerror.o -I/opt/homebrew/opt/curl/include
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/lchttppost.c -o src/lchttppost.o -I/opt/homebrew/opt/curl/include
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/lcurl.c -o src/lcurl.o -I/opt/homebrew/opt/curl/include
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/lcutils.c -o src/lcutils.o -I/opt/homebrew/opt/curl/include
src/lcutils.c:358:12: warning: cast to smaller integer type 'curl_socket_t' (aka 'int') from 'void *' [-Wvoid-pointer-to-int-cast]
    return (curl_socket_t)lua_touserdata(L, idx);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/lcmulti.c -o src/lcmulti.o -I/opt/homebrew/opt/curl/include
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/lcshare.c -o src/lcshare.o -I/opt/homebrew/opt/curl/include
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/lcmime.c -o src/lcmime.o -I/opt/homebrew/opt/curl/include
src/lcmime.c:186:20: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    for(i=0;method = lcurl_mime_part_fields[i]; ++i){
            ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lcmime.c:186:20: note: place parentheses around the assignment to silence this warning
    for(i=0;method = lcurl_mime_part_fields[i]; ++i){
                   ^
            (                                 )
src/lcmime.c:186:20: note: use '==' to turn this assignment into an equality comparison
    for(i=0;method = lcurl_mime_part_fields[i]; ++i){
                   ^
                   ==
1 warning generated.
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/opt/homebrew/opt/lua/include/lua5.4 -c src/lcurlapi.c -o src/lcurlapi.o -I/opt/homebrew/opt/curl/include
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -bundle -undefined dynamic_lookup -all_load -o lcurl.so src/l52util.o src/lceasy.o src/lcerror.o src/lchttppost.o src/lcurl.o src/lcutils.o src/lcmulti.o src/lcshare.o src/lcmime.o src/lcurlapi.o -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lcurl
lua-curl 0.3.13-1 is now installed in /opt/homebrew (license: MIT/X11)
  1. Run the lua script containing local curl = require("curl"). This produces:
/opt/homebrew/Cellar/luarocks/3.8.0/share/lua/5.4/curl.lua:11: module 'lcurl' not found:
        no field package.preload['lcurl']
        [lua searcher]: module not found: 'lcurl'
        no file '/opt/homebrew/Cellar/luarocks/3.8.0/share/lua/5.4/lcurl.lua'
        no file '/opt/homebrew/share/lua/5.4/lcurl.lua'
        no file '/opt/homebrew/share/lua/5.4/lcurl/init.lua'
        no file '/opt/homebrew/lib/lua/5.4/lcurl.lua'
        no file '/opt/homebrew/lib/lua/5.4/lcurl/init.lua'
        no file './lcurl.lua'
        no file './lcurl/init.lua'
        no file '/Users/jessebrault/.luarocks/share/lua/5.4/lcurl.lua'
        no file '/Users/jessebrault/.luarocks/share/lua/5.4/lcurl/init.lua'
stack traceback:
        [C]: in function 'require'
        /opt/homebrew/Cellar/luarocks/3.8.0/share/lua/5.4/curl.lua:11: in main chunk
        [C]: in function 'require'
        ./vazneExamples.lua:1: in main chunk
        [C]: in function 'require'
        [\directlua]:2: in main chunk.

N.B. In my case, the lua script is a script for LuaLaTeX.

Using find /opt/homebrew -name lcurl and similar, I can find no lcurl files installed whatsoever.

I suspect this is related to #183, as I also had to separately install cURL (via homebrew, see above), perhaps something isn't working at that step and lua-curl depends on it?

Any help would be greatly appreciated as I would love to use this library in my project!

from lua-curlv3.

samlux04 avatar samlux04 commented on June 12, 2024

Search your entire system for lcurl.so
You can tell from the log it successfully compiled lcurl.so without any error.
Usually it's because you don't configure the path correctly
luarocks path

from lua-curlv3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.