Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Info: This message was accepted for relay by smtp02.mrf.mail.rcn.net as the sender used SMTP authentication X-Trace: UmFuZG9tSVb2efugq8O+MpUktBO7+9ZBh3bpF/YEGDfyTX2h6nLMeRXPtz7HID95 Message-ID: <3F2926AA.40803@cygwin.com> Date: Thu, 31 Jul 2003 10:24:42 -0400 From: Larry Hall Reply-To: cygwin AT cygwin DOT com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mischa CC: cygwin AT cygwin DOT com Subject: Re: Developing with cygwin: library troubles References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 AT 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/