Firebird - link static library

Michael Stahl mstahl at redhat.com
Thu Jul 21 10:55:29 UTC 2016


On 20.07.2016 21:18, Bunth Tamás wrote:
> The patch:
> https://gerrit.libreoffice.org//25673/
> 
> has an error on Windows (patch set 42):
> LINK : fatal error LNK1181: cannot open input file 'tommath.lib'
> 
> I think it's because I created tommath.lib using the ar linux command,
> and the result is slightly different from the .lib file that msvc
> expects.[1][2]
> 
> I would have liked to use lib.exe to create tommath.lib instead, which
> seems to be the tool on Windows to create a .lib file, but I couldn't
> find the appropriate makefile marco to use it (like the LD variable
> stores the path of link.exe), since the variable AR stores "ar" in
> case of Windows too.
> 
> Am I right about the cause of the issue, and if so, how can I refer to
> lib.exe to use it for creating tommath.lib?

looking at com_MSC_class.mk, the command to link a static library goes
like this: link.exe -LIB ***.obj -out:foo.lib

are you using the autoconf_wrappers?  then the variable LD points to
link.exe (not to gcc-wrapper.exe) so if tommath makefiles use "$(LD)
-lib" to link you might have some success, but of course there's no
mapping of unix-ld-flags to link.exe flags in this case since link.exe
is directly invoked...

perhaps try overriding LD="$(CXX) -lib" or something along those lines -
there is some translation of unix-ld-flags in gcc-wrapper.exe, see the
function "processccargs".

the gcc-wrappers were intended to be called by autoconf tests and by
libtool, if your project doesn't use libtool i'm not sure they will
translate all of the parameters used etc.



More information about the LibreOffice mailing list