Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lua for windows https error: "%1 is not a valid Win32 application"

I've got a question about Lua and https. I'm developing some software for a router which supports Lua. The bad thing is that this router doesn't support debugging. So I was looking for an IDE for Lua.

I'm using the Lua Development Tools and LuaForWindows on a Win 7 64-bit OS. Till now everything works like it should. But now I have to call some urls by https. The router itself has a package ssl.lua and you can user this package with the require ("ssl.https") statement. But I want to debug it with the Lua Development Tools. I was searching for Windows compatible packages and have found the "Luasec" project.

As mentioned in this thread "Lua with the Freebase API"; I have downloaded Luasec.

I have put the ssl.lua and the ssl folder within my lua installation the I have put the ssl.dll in the clibs folder within the lua installation.

For testing I only do a require ("ssl.https") in my Lua file but it crashes. It says:

C:\Program Files (x86)\Lua\5.1\lua.exe: error loading module 'ssl.core' from file 'C:\Program Files (x86)\Lua\5.1\clibs\ssl.dll':
    %1 ist keine zulässige Win32-Anwendung. (%1 is no a valid Win32 application)

I've tested it on a Win 7 32 bit pc too and it crashes with this:

C:\Program Files\Lua\5.1\lua.exe: error loading module 'ssl.core' from file 'C:\Program Files\Lua\5.1\clibs\ssl.dll':
    Das angegebene Modul wurde nicht gefunden. (The module cant be found)

Can anybody please help me getting this work?

like image 947
ChristianR Avatar asked Jul 17 '13 07:07

ChristianR


1 Answers

I had this same problem on Windows 7 64 bit as well, using Alien to load a Windows DLL.

The library I was loading (i.e. the DLL) is a 64 bit DLL, but Lua for Windows is a 32 bit application.

I have a 32-bit version of the DLL that I loaded instead, and that works. See if you too can find a 32 bit version of your library.

As for your problem on 32 bit Windows, that could of course be due to other factors, though if you are using the same 64 bit DLL, I guess that won't work either.

like image 156
mydoghasworms Avatar answered Sep 21 '22 22:09

mydoghasworms