Waiting for the wind

programming memo in different platforms

「msys’s Road」分類文章彙整

use VC++ generated DLL files in msys

發文作者 cotton5415 於 四月 25, 2010

  1. make your DLL file with export symbols project by VC++, you should have AAA.dll and AAA.lib
  2. to generate libAAA.a for msys or cygwin to use, you should:
    1. generate AAA.def by pexports.exe in msys
      % pexports.exe AAA.dll > AAA.def
    2. generate libAAA.a by dlltool.exe in msys
      % dlltool.exe -D AAA.dll -d AAA.def -l libAAA.a
  3. remember to re-define AAAAPI_EXPORTS as blank which is generated by VC++ in AAA.h as you create the export symbol project.
    #define AAAAPI_EXPORTS __declspec(dllimiport)
    --> #define AAAAPI_EXPORTS
    or you will get the link error:
    error LNK2001: unresolved external symbol __imp__FUNC

發表於 msys's Road, Win32's Road | 已加上的標籤: , , , , , | 張貼留言 »

 
Follow

Get every new post delivered to your Inbox.