www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - Compiling static lib

reply "Mars" <- -.-> writes:
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
Feb 15 2012
next sibling parent GreatEmerald <pastas4 gmail.com> writes:
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.
Mar 16 2012
prev sibling parent "Carl Sturtivant" <sturtivant gmail.com> writes:
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
Dec 31 2012