lua-users home
lua-l archive

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


Here is the simple makefile I used for my tests:

LUA_INCLUDE= d:\stuff\lua\src
LFW= c:\Program Files\Lua\5.1
LUA_LIB="$(LFW)\lua5.1.dll"
RT_LIB="$(LFW)\msvcr80.dll"

lfs.dll: lfs.c lfs.h
	gcc -shared -I$(LUA_INCLUDE) lfs.c -o lfs.dll $(LUA_LIB) $(RT_LIB)

(mingw is nice in that way; just point it at a DLL!)

FYI, here is the mapping to the new names that msvcr80.dll contains:

#define _ctime _ctime32
#define _difftime _difftime32
#define _findfirst _findfirst32
#define _findnext _findnext32
#define _fstat _fstat32
#define _ftime _ftime32
#define _futime _futime32
#define _gmtime _gmtime32
#define _localtime _localtime32
#define _mkgmtime _mkgmtime32
#define _mktime _mktime32
#define _stat _stat32
#define _time _time32
#define _utime _utime32
#define _wctime _wctime32
#define _wfindfirst _wfindfirst32
#define _wfindnext _wfindnext32
#define _wstat _wstat32
#define _wutime _wutime32

I don't claim that this is an exhaustive list - yet!

steve d.

On Wed, Jul 16, 2008 at 3:36 PM, RJP Computing <rjpcomputing@gmail.com> wrote:
> On Wed, Jul 16, 2008 at 8:55 AM, steve donovan <steve.j.donovan@gmail.com>
> wrote:
>>
>> I used the depends.exe tool from the Platform SDK and got a much more
>> specific error:
>>
>> 'Cannot find procedure entry point __findfirst in msvcr80.dll'
>>
>> And true enough, with dumpbin /exports I note that it doesn't export
>> this, but a set of functions like
>> _findfirst32,_findfirst32i64,_findfirst64
>>
>> That suggested a solution - just #define _findfirst to be
>> _findfirst32, etc. Since the libmsvcr80.a  then complained, I just
>> linked straight against msvcr80.dll, and voila...
>>
>> gcc -shared -Id:\stuff\lua\src lfs.c -o lfs.dll lua5.1.dll msvcr80.dll
>>
>> (note: I had already made -lmsvcr80 to be my default by editing the
>> mingw gcc spec file)
>>
>> So it appears to work, through a semi-horrible hack!  Although the
>> rest now seems clear, and I could probably knock a _working_
>> libmsvcr80.a together from this information...
>>
>> Thanks for indulging my talking aloud here; this may be useful to
>> others...
>
> I am VERY interested in this. Can you continue to keep this thread alive
> with updates. I would like a simple robust solution to use MinGW's toolchain
> as well.
> --
> Regards,
> Ryan
> RJP Computing
>