GithubHelp home page GithubHelp logo

mingw32 build with MSVCR80 about luafilesystem HOT 1 CLOSED

1linux avatar 1linux commented on September 27, 2024
mingw32 build with MSVCR80

from luafilesystem.

Comments (1)

1linux avatar 1linux commented on September 27, 2024

How to solve the problem "unknown _findfirst" issue with luafilesystem / luarocks / mingw+MSVCR80

Background:
Starting with MSVCR71 Microsoft renamed a lot of routines for the sake of compatibility with 32/64 Windows.

luafilesystem (as of version 1.6.2) still uses the old "MSVCRT.dll" 32 Bit routines.

Current "luarocks" for Windows however uses MSVCR80.dll (as of November 2013)

So if you have a build environment with current luarocks and mingw32, you have the problem that luafilesystem is also built against MSVCR80.dll - and your lua program will fail using any of the lfs-functions.

The solution ist very simple: Don´t use MSVCR80.

The way ist not too hard. The caveat is: You cannot use the simple "luarocks install luafilesystem".
You have to do it by hand.

The way:

Start a Windows Command processor (cmd.exe)
Say "luarocks install luafilesystem"
-> Now you have a lfs.dll which does not work mit your installation (try it - if it works hooray you are done).

Otherwise continue:
Say "luaroks unpack luafilesystem"
-> luarocks fetches luafilesystem from the repo
Say "cd luafilesystem-1.6.2-1"
Say "cd luafilesystem-1.6.2"
Say "luarocks make"
-> It builds everything and installs it to your luarocks directory (still not functionning)
-> It builds with the following command:
mingw32-gcc -shared -o lfs.dll src/lfs.o c:/users/public/lua/LuaRocks/2.1/lua5.1.lib -lMSVCR80
-> "-lMSVCR80" is the enemy - it forces mingw32 to link against MSVCR80.dll
-> So take the same line without it:
Say "mingw32-gcc -shared -o lfs.dll src/lfs.o c:/users/public/lua/LuaRocks/2.1/lua5.1.lib"
Now there is a "lfs.dll" with around 64kb. Copy this dll to your lua installation directory

If size is a concern, you can make lfs.dll even smaller:
Say "strip lfs.dll"
-> Now around 19kb

If there is any better way, please tell!

Regards
Helmut

from luafilesystem.

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.