linker @ meaning and how to compile static libs

Kim kim at ktr.co.nz
Thu Feb 2 16:38:56 PST 2012


Hi,
I am compiling parts of the 7zip SDK (the 7zDec.exe) as a static lib.
I am having issues with compile a static lib (from c code, using dmc 
8.50) that I can use with D v1.072.
The main question is how do I either compile the library with the right 
version suffix (@12)
Or get the linker to use the right version suffix (@8)

Generate Lib
dmc -o -c ..\src\7zAlloc.c ... xxx.c
lib -c 7z.lib bin\7zAlloc.obj ... xxx.obj

lib contents:
_main7zDec at 8

compile and link with .d:
xfbuild sevenz.d 7z.lib +o7zDec.exe +D=.deps +O=.objs +full +v +R 
-release -O -inline -L/M -version=Unicode -version=Tango 
-L/SUBSYSTEM:console:5

OPTLINK (R) for Win32  Release 8.00.12
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.objs\sevenz.obj(sevenz)
  Error 42: Symbol Undefined _main7zDec at 12
--- errorlevel 1

 From Kim



More information about the Digitalmars-d-learn mailing list