lua-users home
lua-l archive

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


Hi lua-l@,

What is the right approach to use an external C library when building a
C module to be used with a Lua program?

I'm building a C module to access some GDAL library functions and
linking with Lua. However, when I try to run the Lua program, I get
this:

When I link only with Lua, no problem. However, if I add the GDAL
headers and link it with the external library (in C module), I get the
following error trying to run the Lua program:

    lua51: error loading module 'lgdal' from file './lgdal.so':
            Cannot load specified object
    stack traceback:
            [C]: ?
            [C]: in function 'require'
            ./nmodeller.lua:3: in main chunk
            [C]: ?

I can understand why Lua can't load this external library, but I don't
have a clue of the best way to do this.

Thank you.