Trouble linking against vendor supplied DLL.

Charles Krug Jr. charles@pentek.com
Tue Nov 30 23:39:00 GMT 1999


"Charles Krug Jr." wrote:
> 
> Hello List:
> 
> I'm building a program and trying to link against a vendor supplied .dll
> using their .lib file.  The code in question has successfully been built
> under VC.  I'm now attempting to build under cygwin.


Okie, got it solved BUT I still find that dlltool does not correctly
create the import library.  Here's the makefile section that does what I
needed to do.  If you see any obvious shortcomings, please tell me about
them.

universe.def:	c:/WinUni/lib/universe.lib
#	dlltool --export-all --output-def $@ $?
#  This doesn't work.  I'm probably giving dlltool the 
#  wrong options.
#
	echo 'EXPORTS' > tmp.def
	-for o in $?; do \
	  nm --extern-only --defined-only $$o | \
	  sed -e 's/[^ ]* [^ ]* //' \
	      -e 's/^_//' \
	      -e 's/^_imp/imp/' \
	      -e 's/.*://' \
	      -e 's/^\..*//' \
	      -e '/^$$/d' | \
	  fgrep -v DllEntryPoint | fgrep -v DllMain | \
	  fgrep -v impure_ptr >> tmp.def;\
	done
	mv tmp.def $@

libuniverse.a:	universe.def
	dlltool --dllname c:/WINNT/system32/universe.dll --def $< \
	  --output-lib $@

When I invoke dlltool using the --export-all --output-def options, my
resulting .def file has only the EXPORTS line.  I'm probably missing a
command line switch or two.  The sed sequence works for the two cases I
tried, but I'm open to any suggestions as to how to improve it.

Charles

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list