Developing with cygwin: library troubles

Larry Hall cygwin-lh@cygwin.com
Thu Jul 31 16:37:00 GMT 2003


Mischa wrote:

> Hi
> 
> I want to develop a windows program that reads the GUID from a MSI package
> with C. It was no problem to create an exe-file with gcc that runs on
> non-cygwin platforms (with -mno-cygwin). My problem is the following:
> I need several functions from the Msi.lib (included in Windows Installer
> SDK). I've created a libMsi.a with dlltool and moved it to /lib/w32api/ and
> linked my .o with -lmsi. Compiling and linking worked fine, but if i try to
> run the exe, it want to load a Msi.lib as a Dynamic  Link Library.
> I've tried to create a DLL from the Msi.lib but then an error appears that
> the Function MsiOpenPackageA@8 could not be found.
> 
> I don't see the problem, perhaps it is the convert process from the Msi.lib
> to the libmsi.a? Or is it impossible to use some function from a .lib-file?
> 
> Please help me, i'm desperate! :-)


Indeed.  Forgive me but I have no experience with the MSI toolkit.  Are
you suggesting that msi.lib that's provided with the toolkit is a static
library rather than an import library?  If so, you don't want to use
dlltool at all.  You should be able to just link against msi.lib if it's
a static library (actually you should be able to do this regardless).  If
msi.lib is an import library, then you must have given dlltool some wrong
information if it's trying to load it as the DLL.  There must be msi.dll
(or whatever DLL the import library has stubs for) somewhere.  That's
what you need to tell dlltool to use.  Still, that's likely to be allot
of work for nothing.  You should try just linking against msi.lib (or
even the DLL directly).

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list