Thread overview
Compiling static lib
Feb 15, 2012
Mars
Mar 16, 2012
GreatEmerald
Jan 01, 2013
Carl Sturtivant
February 15, 2012
Hello, everybody.

I'm trying to compile Lua, using DMC, since I need the lib in OMF. I got the compilation working, but I have no clue, on how to turn the .obj files into a .lib. In D I'd use the -lib argument, but I couldn't figure out how to do this with DMC/OPTLINK yet.
If I just do
> dmc src\lapi.c src\lauxlib.c [...] -olua5.1.lib
I get
> OPTLINK : Warning 134: No Start Address
and when trying to use this .lib
> Not a Valid Library File
from DMD.

What's the correct way to do this?

Mars
March 16, 2012
I believe that you can simply convert the Lua DLL that is available from their website into a LIB by using IMPLIB, included in Basic Utilities available from Digital Mars website.
January 01, 2013
On Wednesday, 15 February 2012 at 13:49:45 UTC, Mars wrote:
> Hello, everybody.
>
> I'm trying to compile Lua, using DMC, since I need the lib in OMF. I got the compilation working, but I have no clue, on how to turn the .obj files into a .lib. In D I'd use the -lib argument, but I couldn't figure out how to do this with DMC/OPTLINK yet.
> If I just do
>> dmc src\lapi.c src\lauxlib.c [...] -olua5.1.lib
> I get
>> OPTLINK : Warning 134: No Start Address
> and when trying to use this .lib
>> Not a Valid Library File
> from DMD.
>
> What's the correct way to do this?
>
> Mars

If you don't just want an import library (which still needs the DLL at runtime) then don't use implib. That is, if you want a self-contained static library, instead use
  dmc -c lapi.c lauxlib.c [...]
to compile each source file to an OMF object file.

Now use the librarian that comes with dmc to construct an OMF lib from all those objects.
  lib lua.lib lapi.obj lauxlib.obj [...]

http://www.digitalmars.com/ctg/lib.html