пятница, 14 августа 2009 г.

Юзаешь dll - сделай import library

Usage of DLL libraries require the generation of import libraries in order for them to be called from C/C++ programs in Visual Studio. This is actually quite simple:
  • Use the dumpbin tool provided with Visual Studio to extract the functions exported from the DLL (dumpbin /EXPORTS xxx.dll > xxx.def).
  • Strip this list, so that it only contains the names for the exported functions; one on each line. Let the first line contain the word EXPORTS.
  • Function names can be renamed to account to different naming convensions by writing importname=dllname (e.g. sgemv=sgemv_).
  • Use the lib tool to generate import libraries (lib /def:xxx.def /MACHINE:IX86 /out:xxx.lib).
More details can be found in Microsoft KB131313, and Stdcall and DLL tools of MSVC and MinGW.

[нашел в интернете]

Комментариев нет: