lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I’ve tried all the options here https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#developer_command_prompt_shortcuts without success.

 

From: Thijs Schreijer <thijs@thijsschreijer.nl>
Sent: 14 June 2022 10:09
To: Lua mailing list <lua-l@lists.lua.org>
Subject: Re: Creating a 32 bit dll for lpeg using Luarocks

 

 



 

I'm using Luarocks (with the compiler from Visual Studio 2022) to install the lpeg module. It appears to work well, except when I require the resultant lpeg.dll I get:

 

An error has occurred – [snip] error loading module 'lpeg' from file 'C:\Program Files (x86)\XXXX\Lua\lpeg.dll': %1 is not a valid Win32 application.

 

which suggests to me that it has been linked as a 64-bit dll whereas the environment in which it is running must be 32-bit.

 

I can find various instructions on how to configure VS to produce 32-bit dlls by altering project settings, but nothing on how to make Luarocks do the same. MinGW isn't an option

 

How do I force Luarocks and Visual Studio 2022 to create a 32-bit dll? I can use Visual Studio 2017 or 2019 if that would provide a solution.

 

From ancient memory; there was a batch file that would set up things “ vcvarsall.bat” or similar. One could use that to instruct the shell to set up targets; 64/32, debug/non-debug etc.

 

Hth

Thijs