Linking to 3rd-party DLL

Torben Mikael Hansen TMH@mic.dtu.dk
Wed May 12 01:37:00 GMT 1999


I am having a problem linking to a third party DLL.

Linking against the applied LIB-file for MS VC causes no error at
compile-time but at when running the program causes the following
message: ...linked to missing export AXDRV32:

Producing a archive-file by

echo EXPORTS > axdrv32.def
nm axdrv32.lib | grep '^........ [T] _' | sed 's/[^_]*_//' >>
axdrv32.def
dlltool --as=as --dllname axdrv32.dll --def axdrv32.def --output-lib
axdrv32.a

and using this to link against causes the following run-time message:
...linked to missing export AXDRV32:axInitialize@4

Producing a archive-file by

echo EXPORTS > axdrv32.def
nm axdrv32.lib | grep '^........ [T] _' | sed 's/[^_]*_//' | sed
's/@[^.]//' >> axdrv32.def
dlltool --as=as --dllname axdrv32.dll --def axdrv32.def --output-lib
axdrv32.a

which removes the '@4' and equivalent for other functions
causes 'undefined reference' error at compile-time linking

Then removing the WINAPI (which is only recognised when it's at its own
line) from the predefinition and using the last archive file causes no
errors for a limited number of functions but of cause for more function
calls, the stack becomes corrupted and the program crashes.

Does anybody have an idea on how to solve this problem.

I'm using cygwin b20.1

The functions definition is:

WORD
WINAPI
axInitialize(LPSTR lpstrIniFile);

Thanks Torben
___________________________________________________
Mikroelektronik Centret
DTU Building 345e, DK-2800 Lyngby, Denmark

office:	157
tel:   	+45 4525 5731
fax:		+45 4588 7762
email: 	tmh@mic.dtu.dk




More information about the Cygwin mailing list