lua-users home
lua-l archive

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


>> Hi, im trying to get lua to work with my compiler, but evry time I 
>> compile/link it tells me that theres an undefined reference 
>> to lua_open and 
>> other lua functions.  I have the lua dll's, lib's and def 
>> files as well as 
>> all the include's.
>> 
>> Do I need to import something from the dll's?  I am linking 
>> the .lib files 
>> to my program.  I know this is not the best place to ask this 
>> question, but 
>> I dont know where else to go.
>> 
>> I am using ming32 for windows (a Windows port of Gcc, I 
>> think) and Dev-C++ 
>> as an IDE.
>> 
>> Any help will be apreciated.
>> 
>> Denis Lamarche
>
>As far as I know, mingw does not link to microsoft's .lib files. You have
to build the libs liblua.a and liblualib.a >yourself using mingw. This will
allow you to *statically* link your application to the lua libs. If you
really need or want >to use the dll, maybe someone else can help you 'cause
I don't know how to do it (but will love to learn).
>
>Andre de Leiradella

Ok, I took a look at the binutils provided with mingw32 and I found an
utility that may help to build an import library (a library that, when
linked to an application, causes its corresponding dll to be loaded) called
dlltool.exe.

I tried it with an dll SDL.dll and it produced libSDL.a: dlltool -l libSDL.a
SDL.dll

If you link the .a file produced by dlltool to your application it causes
the dll used to create it to be loaded. I didn't test it but it *should*
work.

Sorry to post compiler-specific info here but hey, let's help everyone we
can to use Lua ;-)

Andre de Leiradella