Lua-cURL / Lua-cURLv3

Lua binding to libcurl
MIT License
274 stars 63 forks source link

Question regarding MinGW naming convention #193

Closed saspivey98 closed 3 weeks ago

saspivey98 commented 3 weeks ago

For reference, I was able to figure out a solution but I just don't understand why it works the way it does. Was hoping for some insight from someone wiser.

I am running Windows 10 and was trying to install lua-cURL.

I installed mingw-w64-x86_64-curl, which installed the following: image

When trying to install via luarocks:

PS > luarocks install .\lua-curl-0.3.13-1.win32-x86_64.rock CURL_DIR=C:\msys64\mingw64

Error: Could not find library file for CURL
  No file cyglibcurl.dll in C:\msys64\mingw64\lib
  No file cyglibcurl.dll in C:\msys64\mingw64
  No file cyglibcurl.dll in C:\msys64\mingw64\bin
  No file libcurl.dll in C:\msys64\mingw64\lib
  No file libcurl.dll in C:\msys64\mingw64
  No file libcurl.dll in C:\msys64\mingw64\bin
  No file liblibcurl.dll in C:\msys64\mingw64\lib
  No file liblibcurl.dll in C:\msys64\mingw64
  No file liblibcurl.dll in C:\msys64\mingw64\bin
You may have to install CURL in your system and/or pass CURL_DIR or CURL_LIBDIR to the luarocks command.
Example: luarocks install lua-curl CURL_DIR=/usr/local

I took a look around in the C:\msys64\bin\ directory and found a file called libcurl-4.dll. I copied and renamed it to just libcurl.dll and it now works fine. Why does it add the -4? Should the luarocks installer be looking for a suffix?

rfl890 commented 3 weeks ago

The -4 is a naming convention to prevent ABI breakage. You can safely remove it. It's there because of Unix shared library conventions (ie somelibrary.so.N). On windows most apps just bundle DLLs, so there is no such convention.