lua-users home
lua-l archive

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


Steve Litt <slitt@troubleshooters.com> writes:
>> [spc]lucy:~/source/lua/C>gcc -shared -fPIC -o construct.so construct.c
>
> Why the -shared and the -fPIC? Are they necessary? I was able to get a similar 
> program to work without them.

"-shared" and "-fPIC" are necessary to create a dynamically-loadable
object ("xxx.so") using gcc, which allows you to just load it into an
existing Lua executable.

You don't _need_ to do that, of course -- many programs just link the
C code and the Lua libraries when building normally.  In that case, you
don't need to use -shared/-fPIC.

-Miles

-- 
History, n. An account mostly false, of events mostly unimportant, which are
brought about by rulers mostly knaves, and soldiers mostly fools.